新手求教,大神們,多表模糊查詢后,獲得的內(nèi)容數(shù)量如何傳到分頁(yè)中?
數(shù)據(jù)庫(kù)中測(cè)試的查詢:
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個(gè)模型的數(shù)量,如何傳入從所有模型中查詢內(nèi)容的數(shù)量?
頁(yè)面執(zhí)行查詢語(yǔ)句
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)》
{php $query=urlencode('sql語(yǔ)句');} {sql sql='$query'} {$t.字段} {/sql} {$debug} {$pages}回復(fù)@K大帥 就是用的這查詢的,但是多表查詢出來(lái)后,組成一個(gè)新的臨時(shí)表,系統(tǒng)自帶的分頁(yè)只獲取的模型數(shù)量,
{php $query=urlencode('sql語(yǔ)句');} {sql sql='$query'} {$t.字段} {/sql} {$debug} {$pages}太復(fù)雜了,完全看不懂
把解析后結(jié)果和debug發(fā)出來(lái)呀,怎么會(huì)組成新表呢
回復(fù)@二開/定制/使用解答專家
就是從這6個(gè)模型中 查詢標(biāo)題、關(guān)鍵字、內(nèi)容中包含‘車牌’ 這個(gè)標(biāo)簽的文章,然后把查詢內(nèi)容的總數(shù)傳到分頁(yè)中,然后進(jìn)行分頁(yè),目前的分頁(yè)顯示的是6個(gè)模型的數(shù)量,不是所匹配的內(nèi)容總量
回復(fù)@K大帥
debug
標(biāo)簽解析:{list action=sql sql='select+%2A+from+%28select+title%2Ckeywords%2Cinputtime%2Cdescription%2Curl%2Ccontent+from+dr_1_news+where+title+like+%22%25%E5%87%BA%E7%A7%9F%25%22+OR+keywords+like+%22%25%E5%87%BA%E7%A7%9F%25%22+OR+content+like+%22%25%E5%87%BA%E7%A7%9F%25%22%0Aunion+all%0Aselect+title%2Ckeywords%2Cinputtime%2Cdescription%2Curl%2Ccontent+from+dr_1_qcp+where+title+like+%22%25%E5%87%BA%E7%A7%9F%25%22+OR+keywords+like+%22%25%E5%87%BA%E7%A7%9F%25%22+OR+content+like+%22%25%E5%87%BA%E7%A7%9F%25%22%0Aunion+all%0Aselect+title%2Ckeywords%2Cinputtime%2Cdescription%2Curl%2Ccontent+from+dr_1_zhuanr+where+title+like+%22%25%E5%87%BA%E7%A7%9F%25%22+OR+keywords+like+%22%25%E5%87%BA%E7%A7%9F%25%22+OR++content+like+%22%25%E5%87%BA%E7%A7%9F%25%22%0Aunion+all%0Aselect+title%2Ckeywords%2Cinputtime%2Cdescription%2Curl%2Ccontent+from+dr_1_tix+where+title+like+%22%25%E5%87%BA%E7%A7%9F%25%22+OR+keywords+like+%22%25%E5%87%BA%E7%A7%9F%25%22+OR++content+like+%22%25%E5%87%BA%E7%A7%9F%25%22%0Aunion+all%0Aselect+title%2Ckeywords%2Cinputtime%2Cdescription%2Curl%2Ccontent+from+dr_1_zhin+where+title+like+%22%25%E5%87%BA%E7%A7%9F%25%22+OR+keywords+like+%22%25%E5%87%BA%E7%A7%9F%25%22+OR++content+like+%22%25%E5%87%BA%E7%A7%9F%25%22%0Aunion+all%0Aselect+title%2Ckeywords%2Cinputtime%2Cdescription%2Curl%2Ccontent+from+dr_1_wend+where+title+like+%22%25%E5%87%BA%E7%A7%9F%25%22+OR+keywords+like+%22%25%E5%87%BA%E7%A7%9F%25%22+OR++content+like+%22%25%E5%87%BA%E7%A7%9F%25%22%29+AS+a' order=hits page=1 pagesize=5 urlrule=index.php?s=tag&c=home&m=index&name=chepai&module=&type=&page=[page]}查詢解析: 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 LIMIT 0,5開發(fā)模式:已開啟數(shù)據(jù)緩存:開發(fā)者模式下緩存無(wú)效總記錄數(shù):6分頁(yè)功能:已開啟當(dāng)前頁(yè)碼:1總頁(yè)數(shù)量:2每頁(yè)數(shù)量:5分頁(yè)地址:index.php?s=tag&c=home&m=index&name=chepai&module=&type=&page=頁(yè)碼可用字段:title、keywords、inputtime、description、url、content回復(fù)@K大帥 補(bǔ)充個(gè)debug的截圖