欢迎来到站长资源
帮助中心

站长资源

帝国cms灵动标签调用多表多模型调用文章的方法

  • 时间:2021-01-28 23:18 编辑: 来源: 阅读:118
  • 扫一扫,手机访问
摘要:调用多模型的最新文章[e:loop={'select * from ( select id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_movie where newstime union select id,cla

调用多模型的最新文章

[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]

帝国CMS多表调用最新信息,该演示代码为默认数据表下全站最新10条图片信息,自己根据需求可以附加条件,实现全站点击,全站头条,全站推荐等等.
注释:以上多个模型用“Union”连接调用
若只调用图片:要加ispic=1条件
举例:

[e:loop={'select * from (select id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_news where newstime and ispic=1 unionselect id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_photo where newstime and ispic=1 unionselect id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_flash where newstime and ispic=1 unionselect id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_article where newstime and ispic=1) a order by newstime desc limit 10',10,24,1}]
<a href="<?=$bqsr['titleurl']?>" target="_blank"><img src="<?=$bqr['titlepic']?>"/><?=$bqr['title']?></a> <br>
[/e:loop]


  • 全部评论(0)
上一篇:帝国CMS7.5使用PHP7.x环境登录后台报错的解决方法!
下一篇:已是最后一篇内容
最新发布的资讯信息
【站长资讯|】让你的图片更加清晰精美,6个图片无损放大网站推荐(2023-09-21 21:12)
【建站教程|thinkphp教程】Thinkphp5 自定义上传文件名的实现方法(2021-01-29 00:24)
【建站教程|thinkphp教程】ThinkPHP5.1框架数据库链接和增删改查操作示例(2021-01-29 00:23)
【建站教程|thinkphp教程】Thinkphp自定义生成缩略图尺寸的方法(2021-01-29 00:22)
【建站教程|thinkphp教程】thinkPHP和onethink微信支付插件分享(2021-01-29 00:19)
【建站教程|wordpress教程】wordpress媒体库(2021-01-29 00:08)
【建站教程|wordpress教程】Wordpres多站点配置(站群建设)详细方法(2021-01-28 23:51)
【建站教程|wordpress教程】WordPress找回忘记密码(2021-01-28 23:43)
【本网资讯|】源码交易怎么操作比较安全?(2021-01-28 23:40)
【本网资讯|】网站交易流程及购买网站费用(2021-01-28 23:40)
联系我们
邮箱:pdlorg@163.com
时间:09:00 - 次日02:00
首页底部图片