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++;}} |
新闻热点
疑难解答