**CI中的order_by在get_where之前
 public function show_list_by_order($array_data, $order_field, $order_mode)
    {
        $query = $this->db->get_where('xm_attach', $array_data);
        $this->db->order_by($order_field, $order_mode);
        //row_array取一行数据;result_array 取多行数据
        return $query->result_array();
        
    }
上面的写法是错误的,需要更改下顺序:
public function show_list_by_order($array_data, $order_field, $order_mode)
{
$this->db->order_by($order_field, $order_mode);
$query = $this->db->get_where('xm_attach', $array_data);
//row_array取一行数据;result_array 取多行数据
return $query->result_array();
}
    如何联系我:【我的公司】www.xinzhenkj.com(信真科技)【技术咨询】www.laohuzx.com  【QQ】3396726884 
图书购买京东链接***微信小程序商城开发实战*** | ***新媒体营销精华:精准定位+爆款打造+匠心运营+内容变现***
 
                    
                
 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号