介绍下帝国CMS用灵动标签调用多表多模型文章信息的写法
调用多模型的最新文章
[e:loop={'select * from ( select id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_movie where newstime union select id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_news where newstime union select id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_photo where newstime union select id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_flash where newstime union select id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_article where newstime ) a order by newstime desc limit 10',10,24,1}] <a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a> <br> [/e:loop]
注释:以上多个模型用“Union”连接调用
帝国CMS多表调用最新信息,该演示代码为默认数据表下全站最新10条图片信息,自己根据需求可以附加条件,实现全站点击,全站头条,全站推荐等等.
免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。
热门教程
帝国CMS7.0对商城系统的功能进行了大更新,功能更完善2019-02-16
帝国cms内容页灵动标签调用当前栏目多篇文章并且排除2019-02-23
帝国CMS技巧:如何添加自定义字段和引用2019-02-14
帝国cms实现首页用灵动标签调用文章内容的方法2019-02-15
帝国CMS7.5版视频播放器更新,做视频站更方便2019-02-23
帝国cms如何导入模板2019-02-13
在帝国cms列表页调用内容页内容字段newstext2019-02-19
帝国cms栏目导航调用之SQL语句调用一级栏目和二级栏目2019-02-23
帝国CMS商城系统在线支付后,订单邮件提醒2019-02-15
帝国CMS整站源码通用安装教程2019-10-11