function fetch_control_no_read() { $select = new database_select(); $select->from($this->name, array('id', 'title', 'style')); $select->where(array('`is_read` = ?' => 0, '`menu` = ?' => 0)); $select->order('date'); $select->limit(50); return $this->adapter->fetch_all($select); }
function fetch_role_title_by_role($rule) { $mr = new model_crole(); $select = new database_select(); $select->from(array('i' => $this->name), array('r.title')); $select->join(array('r' => $mr->name), 'r.id = i.role', ''); $select->where(array('i.parentid' => $rule)); $select->order('r.title'); $select->group('r.id'); return $this->adapter->fetch_col($select); }
function fetch_control_list($where = null, $order = null, $count = null, $offset = null) { $select = new database_select(null, $this->adapter); $select->from($this->name); if ($where) { $select->where($where); } if ($order) { $select->order($order); } if ($count) { $select->limit($count, $offset); } return $select; }