点亮数据表不在的地方

时间:2015-05-12 14:18:41

标签: codeigniter datatables

我使用Ignited Datatables库但不支持WhereNotIn功能,如何将此功能添加到此库中?提前谢谢。

1 个答案:

答案 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]);
  //...      
  }
}