帝国CMS联合查询多表实现全站最新信息调用

 帝国CMS联合查询多表实现全站最新信息调用

帝国CMS多表查询实现全站最新信息调用使用自定义灵动标签 (e:loop)多个SQL查询语句实现

 [e:loop={'select * from (

select id,classid,titleurl,filename,title,newstime,titlepic from phome_ecms_news where newstime union

select id,classid,titleurl,filename,title,newstime,titlepic from phome_ecms_photo where newstime union

select id,classid,titleurl,filename,title,newstime,titlepic from phome_ecms_flash where newstime union

select id,classid,titleurl,filename,title,newstime,titlepic from phome_ecms_article where newstime) a order by newstime desc limit 10',10,24,1}]

[/e:loop]  

帝国CMS多表查询实现全站最新信息调用(演示代码为默认数据表下全站最新10条图片信息),自己根据需求可以附加条件,实现全站点击,全站头条,全站推荐等等,但是该脚本效率较低在有大数据量的时候!

扫一扫手机访问