帝国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')
猜你需要

豫ICP备2021026617号-1  豫公网安备:41172602000185   Copyright © 2021-2028 www.78moban.com/ All Rights Reserved

本站作品均来自互联网,转载目的在于传递更多信息,并不代表本站赞同其观点和对其真实性负责。如有侵犯您的版权,请联系 1565229909#qq.com(把#改成@),我们将立即处理。