帝国cms模板制作 帝国CMS自定义列表按时间调用

帝国CMS教程

帝国cms自定义列表按时间调用

演示代码按8小时、24小时、7天、30天、365天时间调用,大家可以参照代码按实际情况修改3600*72=72小时

8小时内selectcount(*)astotalfrom[!db.pre!]ecms_newswhereunix_timestamp(now())-newstime<3600*720select*from[!db.pre!]ecms_newswhereunix_timestamp(now())-newstime<3600*720orderbyonclickdesc24小时内selectcount(*)astotalfrom[!db.pre!]ecms_newswhereunix_timestamp(now())-newstime<3600*2400select*from[!db.pre!]ecms_newswhereunix_timestamp(now())-newstime<3600*2400orderbyonclickdesc7天内selectcount(*)astotalfrom[!db.pre!]ecms_newswhereunix_timestamp(now())-newstime<3600*7*24select*from[!db.pre!]ecms_newswhereunix_timestamp(now())-newstime<3600*7*24orderbyonclickdesc一个月selectcount(*)astotalfrom[!db.pre!]ecms_newswhereunix_timestamp(now())-newstime<3600*30*24select*from[!db.pre!]ecms_newswhereunix_timestamp(now())-newstime<3600*30*24orderbyonclickdesc一年selectcount(*)astotalfrom[!db.pre!]ecms_newswhereunix_timestamp(now())-newstime<3600*365*24select*from[!db.pre!]ecms_newswhereunix_timestamp(now())-newstime<3600*365*24orderbyonclickdesc