調用多模型的最新文章
[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條圖片信息,自己根據需求可以附加條件,實現全站點擊,全站頭條,全站推薦等等.