帝國cms自定義列表多表查詢統(tǒng)計代碼
統(tǒng)計記錄:
select count(*) as total from [!db.pre!]ecms_news union select count(*) as total from [!db.pre!]ecms_movie
查詢記錄:
select classid,id,titleurl,title,newstime from [!db.pre!]ecms_news union select classid,id,titleurl,title,newstime from [!db.pre!]ecms_movie order by newstime desc
-----------------------注釋:-------------------------------
以上調用的是(新聞模型:news、電影模型:movie)兩個模型的文章,兩個模型用"Union"連接調用
若指定欄目用:where classid in(46,47,51),
若調用推薦在其后追加:and isgood=1,
若指定調用條數(shù)在其后追加:limit 10
責任編輯:實速科技