public function fetch_all_by_sql($where, $order = '', $start = 0, $limit = 0, $count = 0, $alias = '') { $where = $where && !is_array($where) ? " WHERE $where" : ''; if(is_array($order)) { $order = ''; } if($count) { return DB::result_first('SELECT count(*) FROM '.DB::table($this->_table).' %i %i %i '.DB::limit($start, $limit), array($alias, $where, $order)); } return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' %i %i %i '.DB::limit($start, $limit), array($alias, $where, $order)); } |
class table_portal_article_content extends discuz_table { public function fetch_all_by_sql($where, $order = '', $start = 0, $limit = 0, $count = 0, $alias = '') { $where = $where && !is_array($where) ? " WHERE $where" : ''; if(is_array($order)) { $order = ''; } if($count) { return DB::result_first('SELECT count(*) FROM '.DB::table($this->_table).' %i %i %i '.DB::limit($start, $limit), array($alias, $where, $order)); } return DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' %i %i %i '.DB::limit($start, $limit), array($alias, $where, $order)); } |
</p> <p> foreach($query as $article) { $ids .= ','.$article['aid']; $num++; } |
if($num==0){ list($srchtxt, $srchtxtsql) = searchkey($keyword, "content LIKE '%{text}%'", true); $query = C::t('portal_article_content')->fetch_all_by_sql(' 1 '.$srchtxtsql, 'ORDER BY aid DESC ', 0, $_G['setting']['search']['portal']['maxsearchresults']); foreach($query as $article) { $ids .= ','.$article['aid']; $num++; } } |
版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請(qǐng)注明: discuzx3.4文章進(jìn)行全文檢索的實(shí)現(xiàn)方法