search查詢加了條件后,page頁碼不正確
模板文件:search.html
加條件前,分頁頁碼6頁共57條,正常。:{search module=MOD_DIR id=$searchid total=$sototal catid=$catid page=1 pagesize=10 urlrule=$urlrule}
=====
加條件后,{search module=MOD_DIR id=$searchid total=$sototal catid=$catid IN_wzgl=1,2,3 page=1 pagesize=10 urlrule=$urlrule}
分頁頁碼仍然顯示6頁共57條。其實正確的IN_wzgl=1,2,3條件過濾后應該只有10條符合,頁碼一頁。
該怎么改呢
search是固定參數(shù),不能加條件的
參考文檔:《重寫搜索Search類》
開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
方法完美
回復迅睿框架創(chuàng)始人
// 自定義組合查詢條件 protected function mysearch($module, $where, $get) { // 重新對where條件的組裝 // 比如我加一個條件作為搜索條件 // $where[] = "wzgl in (1,2,3) "; // 表加一個zt字段=1的數(shù)據(jù) return $where; }用一樓梯文檔,改改
二樓代碼是對的
三樓的復議是正確的