_table = 'home_docomment'; $this->_pk = 'id'; parent::__construct(); } public function delete_by_doid_uid($doids = null, $uids = null) { $sql = array(); $doids && $sql[] = DB::field('doid', $doids); $uids && $sql[] = DB::field('uid', $uids); if($sql) { return DB::query('DELETE FROM %t WHERE %i', array($this->_table, implode(' OR ', $sql))); } else { return false; } } public function fetch_all_by_doid($doids) { if(empty($doids)) { return array(); } return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('doid', $doids).' ORDER BY dateline', array($this->_table)); } } ?>