Код: Выделить всё
function fetch_data($limit, $start)
{
$this->db->select('pro_id,pro_date,st_target,st_smv,st_name,st_code,pro_account_level,pro_qty,mod_number,modet_desc,a_name,u_name');
$this->db->from("production_report");
$this->db->join('stages','stages.st_id = production_report.pro_stage_id');
$this->db->join('model_details','model_details.modet_id = production_report.pro_model_id');
$this->db->join('models','models.mod_id = model_details.modet_model_id');
$this->db->join('accounts','accounts.a_id = production_report.pro_account_id');
$this->db->join('users','users.u_id = production_report.pro_u_id');
$this->db->order_by("pro_id", "DESC");
$this->db->limit($limit, $start);
$query = $this->db->get();
if ($query->num_rows() > 0) {
foreach ($query->result() as $row) {
$data[] = $row;
}
return $data;
}
return false;
}
Имя ключа
Тип
Уникальный
Упакованный
Столбец
Кардинальность
Сопоставление
Нулевой
Комментарий
ПЕРВИЧНЫЙ
BTREE
Да
Нет
pro_id
425121
A
Нет
pro_date
BTREE
Нет
Нет
pro_date
425121
A
Нет
pro_account_id
BTREE
Нет
Нет
pro_account_id
1368
А
Нет
pro_account_section
BTREE
Нет
Нет
pro_account_section
26
А
Нет
pro_model_id
BTREE
Нет
Нет
pro_model_id
1445
A
Нет
pro_u_id
BTREE
Нет
Нет
pro_u_id
70
A
Нет
pro_stage_id
BTREE
Нет
Нет
pro_stage_id
1407
A
Нет
pro_ro_id
BTREE
Нет
Нет
pro_ro_id
425121
A
Нет

Подробнее здесь: https://stackoverflow.com/questions/782 ... odeignator