帝国cms灵动标签调用多表多模型调用文章的方法
今天有朋友问瓦窑源码小编,帝国cms灵动标签调用多表多模型调用文章的方法,小编经过研究和查找相关资料,找到解决办法。现在发布于此,希望能给有此需求的朋友提供交流。如果有更好的办法,可以加小编好友一起交流哦。
调用多模型的最新文章
[e:loop={'select * from (select id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_movie where newstime unionselect id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_news where newstime unionselect id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_photo where newstime unionselect id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_flash where newstime unionselect id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_article where newstime) a order by newstime desc limit 10',10,24,1}]
接下来就是调用链接为:href="标题为:[/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}]
接下为是调用连接为:图片为:"/>
标题为:[/e:loop]
以上就是关于“帝国cms灵动标签调用多表多模型调用文章的方法”所有内容,有不懂的可以找小编交流哦。
上一个:第一页
下一个:帝国cms用万能的灵动标签SQL语句调用一级栏目分类