<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

用SQL语句获取Dedecms v5.7每个栏目中的文章数量

时间:2020-12-21

下面是代码在前台页面中的显示效果:
      共有会员:72 名 
      本月更新:72 篇 
      共有文章:7272 篇 
      你的栏目名称更新文章(8181篇)
 
SQL语句如下:
{dede:sql sql="select count(mid) as c from dede_member "}共有会员:[field:c /] 名{/dede:sql}
{dede:sql sql="SELECT count( ID ) AS c FROM dede_archives WHERE FROM_UNIXTIME( pubdate, '%m' ) = month(curdate( )) "} 本月更新:[field:c /] 篇{/dede:sql}
{dede:sql sql="select count(*) as c from dede_archives where channel=1"}共有文章:[field:c /] 篇{/dede:sql}
{dede:sql sql='SELECT d.typename,d.id,count(da.id) as heji FROM dede_arctype d left join dede_archives da on da.typeid=d.id where d.reid=0 and da.arcrank>=0 group by d.typename order by heji desc limit 0,8;'}<span><a href="/plus/list.php?tid=[field:id/]">[field:typename/]更新文章</a><span>([field:heji/]篇)</span></span><br />
{/dede:sql}
 希望大家能用得上。
    0
    首页
    案例
    关于
    联系