11.15 应用举例 指定某个时间段 - Lin Huiming (Aaron) - 林茄子
lin huiming
因上努力,果上随缘

11.15 应用举例 指定某个时间段

  • Lin Huiming
  • 8分钟阅读 8min read

11.15 应用举例 指定某个时间段

1、某天发布的文章

[e:loop={'news',10,18,0,'newstime>='.to_time('2010-11-11 00:00:01').' and newstime<='.to_time('2010-11-11 23:59:59').''}]<a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a><?=date("Y-m-d H:i:s",$bqr[newstime])?><br>[/e:loop]

或 (to_time 换成  to_date)

[e:loop={'news',10,18,0,'newstime>='.to_date('2016-07-31 00:00:01').' and newstime<='.to_date('2016-08-31 23:59:59').''}]<a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a><?=date("Y-m-d H:i:s",$bqr[newstime])?><br>[/e:loop]

2、某一段时间发布的文章

[e:loop={'news',10,18,0,'newstime>='.to_time('2016-07-31 00:00:01').' and newstime<='.to_time('2016-08-31 23:59:59').''}]<a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a><?=date("Y-m-d H:i:s",$bqr[newstime])?><br>[/e:loop]

或 

[e:loop={"select * from [!db.pre!]ecms_news where newstime > UNIX_TIMESTAMP('2016-06-01') and newstime < UNIX_TIMESTAMP('2016-08-23')  order by id desc limit 30",30,24,0}] <li><a href="<?=$bqsr[titleurl]?>" target="_blank"><?=DoTitleFont($bqr[titlefont],esub($bqr[title],28))?> </a><?=date("Y-m-d H:i:s",$bqr[newstime])?></li>[/e:loop]

该内容有帮助吗?Was this helpful?

评论 Comment

已有0人参与,点击查看更多评论