详情页

帝国cms调取历史上今天的数据

时间:2023年11月10日

编辑:佚名

我们在用帝国cms开发网站的时候有个功能就是调用历史上的今天的数据,或者是调用每一年的某一天的数据,这个功能在用帝国cms实现是很方便使用灵动标签调用一个数据,但是这个MYSQL调用语法却是比较难的,下面分享下
[e:loop={" select  title from {$dbtbpre}ecms_news where from_unixtime(newstime,'%m-%d')=  from_unixtime(unix_timestamp(now()),'%m-%d') and  from_unixtime(newstime,'%Y')<> from_unixtime(unix_timestamp(now()),'%Y')
order by newstime desc limit 10
",10,24,0}]
<a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a> <br>
[/e:loop]
帝国cms数据调用说明 格式化时间是等于当前时间且不是今年
from_unixtime(newstime,'%m-%d')=  from_unixtime(unix_timestamp(now()),'%m-%d')
from_unixtime(newstime,'%Y')<> from_unixtime(unix_timestamp(now()),'%Y')
相关文章
猜你需要