Мой модальный модуль:
Код: Выделить всё
public function client_list(){
$this->db->select_sum('*', sum('amount'));
$this->db->from('users');
$this->db->join('amount', 'amount.user_id = users.ID');
$query=$this->db->get();
$result=$query->result();
return $result;
}
Код: Выделить всё
public function index(){
$data['records'] = $this->Admin_model->client_list();
$this->load->view('admin/Client_list', $data);
}
Код: Выделить всё
Подробнее здесь: https://stackoverflow.com/questions/491 ... of-columns
Мобильная версия