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();
}