帝国CMS多表调用最新信息的方法,主要通过灵动标签的sql语句调用结合union来实现,是非常实用的技巧,需要的朋友可以参考下!帝国CMS调用所有数据表最新文章
[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_download 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_movie where newstime union
select id,classid,titleurl,filename,title,newstime,titlepic from phome_ecms_shop where newstime union
select id,classid,titleurl,filename,title,newstime,titlepic from phome_ecms_article where newstime union
select id,classid,titleurl,filename,title,newstime,titlepic from phome_ecms_info where newstime) a order by newstime desc limit 7',7,24,0}]
<a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a>
[/e:loop]