简介PHPcms调用热门第一种:{pc:getsql="SELECT*FROM`v9_news`a,`v9_hits`pWHEREa.catid=$catidanda.status=99anda.inputtime>UNIX_TIMESTAMP()-7*3600*24andCONCAT('c-1-',a.id)=p.hitsidORDERBYp.weekviewsDESC"num="15"}{loop
PHPcms调用热门第一种:
{pc:getsql="SELECT*FROM`v9_news`a,`v9_hits`pWHEREa.catid=$catidanda.status=99anda.inputtime>UNIX_TIMESTAMP()-7*<ahref="http://www.zztuku.com/tags/360/"target="_blank">360</a>0*24andCONCAT('c-1-',a.id)=p.hitsidORDERBYp.weekviewsDESC"num="15"}{loop$data$r}<font ="{date("y-m-d',=""$r[inputtime])}"=""style="margin:0px;padding:0px;word-break:break-all;overflow-wrap:break-word;">{date('d',$r[inputtime])}日{str_cut($r[ ],38)}{/loop}{/pc}
其中c-1-中的1代表MODELID 请更换成你自己的模型ID ,经测试此方法超占MYSQL资源
PHPcms调用热门第二种:
SELECTa. ,a.urlFROMv9_newsa,v9_hitsbWHEREa.id=substr(b.hitsid,5)ANDstatus=99ORDERBYb.viewsDESC
注意:substr(b.hitsid,5)的意思是截取v9_hits表里hitsid字段值第5个字符起至结束,请按实际情况修改,如果你的站点ID是两位数,那么这里你要从第6个字符开始,完美一点再加个 a.catid=b.catid
下载链接:网站源码/小程序源码/网站模板下载