你现在的位置:首页 > PHP网站建设知识库 > phpcms > 正文

phpcms v9全站排行榜,收藏量统计查询代码

{pc:get sql="select *,count(*) as count from phpcms_favorite where adddate>=DATE_SUB(CURDATE(),INTERVAL WEEKDAY(CURDATE()) DAY) group by title order by count(*) desc" return="data" num="9"}
<ul>
{loop $data $key $val}
 <li><a href="{str_replace('/index.html','',$val[url])}" target="_blank" title="{$val[title]}">{$val[title]}</a> {$val[count]}</li>
{/loop}
</ul>
{/pc}