聯(lián)系官方銷售客服
1835022288
028-61286886
新手求教,大神們,多表模糊查詢后,獲得的內(nèi)容數(shù)量如何傳到分頁中?
數(shù)據(jù)庫中測試的查詢:
select sum(a.b) as num from ( select count("title,keywords,inputtime,description,url,content") as b from dr_1_news where title like "%出租%" OR keywords like "%出租%" OR content like "%出租%" union all select count("title,keywords,inputtime,description,url,content") as b from dr_1_qcp where title like "%出租%" OR keywords like "%出租%" OR content like "%出租%" union all select count("title,keywords,inputtime,description,url,content") as b from dr_1_zhuanr where title like "%出租%" OR keywords like "%出租%" OR content like "%出租%" union all select count("title,keywords,inputtime,description,url,content") as b from dr_1_tix where title like "%出租%" OR keywords like "%出租%" OR content like "%出租%" union all select count("title,keywords,inputtime,description,url,content") as b from dr_1_zhin where title like "%出租%" OR keywords like "%出租%" OR content like "%出租%" union all select count("title,keywords,inputtime,description,url,content") as b from dr_1_wend where title like "%出租%" OR keywords like "%出租%" OR content like "%出租%" ) as a
查詢結(jié)果是13條
目前查詢到的數(shù)量是 6個模型的數(shù)量,如何傳入從所有模型中查詢內(nèi)容的數(shù)量?
頁面執(zhí)行查詢語句
select * from (select title,keywords,inputtime,description,url,content from dr_1_news where title like "%出租%" OR keywords like "%出租%" OR content like "%出租%" union all select title,keywords,inputtime,description,url,content from dr_1_qcp where title like "%出租%" OR keywords like "%出租%" OR content like "%出租%" union all select title,keywords,inputtime,description,url,content from dr_1_zhuanr where title like "%出租%" OR keywords like "%出租%" OR content like "%出租%" union all select title,keywords,inputtime,description,url,content from dr_1_tix where title like "%出租%" OR keywords like "%出租%" OR content like "%出租%" union all select title,keywords,inputtime,description,url,content from dr_1_zhin where title like "%出租%" OR keywords like "%出租%" OR content like "%出租%" union all select title,keywords,inputtime,description,url,content from dr_1_wend where title like "%出租%" OR keywords like "%出租%" OR content like "%出租%") AS a
為啥不直接用 多模塊內(nèi)容循環(huán)呢?
參考文檔:《多模塊內(nèi)容循環(huán)》
回復(fù)@K大帥 就是用的這查詢的,但是多表查詢出來后,組成一個新的臨時表,系統(tǒng)自帶的分頁只獲取的模型數(shù)量,
太復(fù)雜了,完全看不懂
把解析后結(jié)果和debug發(fā)出來呀,怎么會組成新表呢
回復(fù)@二開/定制/使用解答專家
就是從這6個模型中 查詢標題、關(guān)鍵字、內(nèi)容中包含‘車牌’ 這個標簽的文章,然后把查詢內(nèi)容的總數(shù)傳到分頁中,然后進行分頁,目前的分頁顯示的是6個模型的數(shù)量,不是所匹配的內(nèi)容總量
回復(fù)@K大帥
debug
回復(fù)@K大帥 補充個debug的截圖