|
public function getSomeFieldsByWhere($where, $fields, $num, $offset){
$sql = "SELECT {$fields} FROM {$this->_table} WHERE {$where} LIMIT {$offset}, {$num}";
$query = $this->db->query($sql);
$res = $query->result_array();
return $res;
}
这是我自己封装的, 有没有其他封装的model,我想借鉴一下, 这个不防注入,谢谢了 |
|