优晟SEO

您现在的位置是:首页 > CMS教程 > 帝国cms > 正文

帝国cms

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

佚名 2024-08-24帝国cms
帝国CMS自定义列表按时间调用演示代码按8小时、24小时、7天、30天、365天时间调用,大家可以参照代码按实际情况修改3600*72=72小时8小时内selectcount(*)astotalfrom[!db.pre!]ecms_newswhereunix_timestamp(now())-ne……

帝国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