首页 > CMS > 帝国Empire > 正文

sql调用点击排行和顶排行,怎么指定栏目ID?

2024-08-28 12:27:18
字体:
来源:转载
供稿:网友

[ecmsinfo]"select * from phome_4ecms_news where checked=1 order by diggtop desc,id desc limit 10",10,30,0,24,10,0[/ecmsinfo]
这个是顶的排行

[ecmsinfo]"select * from phome_4ecms_news where newspath >SUBDATE(NOW(),INTERVAL 7 DAY) order by onclick desc limit 10",10,30,0,24,10,0[/ecmsinfo]
这个是点击的排行。。

大虾能告诉我具体怎么改吗!!

因为不按栏目来显示的话。。只要一上新闻就会出现在排行榜!!

select * from phome_4ecms_news where checked=1 and classid in (栏目id1,id2...,idn) order by diggtop desc,id desc limit 10

谢谢楼上大虾。。

[ecmsinfo]"select * from phome_4ecms_news where newspath >SUBDATE(NOW(),INTERVAL 7 DAY) order by onclick desc limit 10",10,30,0,24,10,0[/ecmsinfo]

这个按栏目又怎么写呢。。我用顶的方式写输出无内容了!!谢谢大虾。。我知道我很烦。。

select * from phome_4ecms_news where newspath >SUBDATE(NOW(),INTERVAL 7 DAY) and classid=栏目id order by onclick desc limit 10

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表