[datatables]连接表搜索和排序被codeigniter卡住
这个环节的情况是一样的,看到了正确答案,但为什么不能给出“在哪里”?
private function _get_datatables_query($term=''){ //term is value of $_REQUEST['search']['value']
$column = array('k.id_kota','k.nm_kota', 'p.nm_propinsi');
$this->db->select('k.id_kota, k.nm_kota, p.nm_propinsi');
$this->db->from('kota as k');
$this->db->where('k.id_kota',2); //this problem
$this->db->join('propinsi as p', 'p.id_propinsi = k.id_propinsi','left');
$this->db->like('k.id_kota', $term);
$this->db->or_like('k.nm_kota', $term);
$this->db->or_like('p.nm_propinsi', $term);
if(isset($_REQUEST['order'])) // here order processing
{
$this->db->order_by($column[$_REQUEST['order']['0']['column']], $_REQUEST['order']['0']['dir']);
}
else if(isset($this->order))
{
$order = $this->order;
$this->db->order_by(key($order), $order[key($order)]);
}
}
我将显示所有数据基本id.kota=2,但不能。请帮忙。谢谢
暂无答案!
目前还没有任何答案,快来回答吧!