我使用Ignited Datatables库但不支持WhereNotIn功能,如何将此功能添加到此库中?提前谢谢。
答案 0 :(得分:1)
像这样修补Datatables
类:
class Datatables
{
//...
private $where_not_in = array();
//...
public function where_not_in($key_condition, $val = NULL, $backtick_protect = TRUE)
{
$this->where_not_in[] = array($key_condition, $val, $backtick_protect);
$this->ci->db->where_not_in($key_condition, $val, $backtick_protect);
return $this;
}
private function get_total_results($filtering = FALSE)
{
//...
foreach($this->where_not_in as $val)
$this->ci->db->where_not_in($val[0], $val[1], $val[2]);
//...
}
}