когда я использую этот запрос в codeigniter:
$this->db->where("dopuex_donation_id", $donation_id);
$this->db->select("donation_purposes_expenses.*, SUM(donation_purposes_expenses.dopuex_withdrawn_value) AS count, cases.case_name");
$this->db->from("donation_purposes_expenses");
$this->db->join("expenses", "donation_purposes_expenses.dopuex_expense_id = expenses.expense_id", "left");
$this->db->join("cases", "expenses.expense_type = 1 && expenses.expense_case_ref_id = cases.case_ref_id", "left");
$this->db->group_by("cases.case_name");
return $this->db->get()->result_array();
я получил эту ошибку
Unknown column '1' in 'on clause'
SELECT `donation_purposes_expenses`.*, SUM(donation_purposes_expenses.dopuex_withdrawn_value) AS count, `cases`.`case_name` FROM (`donation_purposes_expenses`) LEFT JOIN `expenses` ON `donation_purposes_expenses`.`dopuex_expense_id` = `expenses`.`expense_id` LEFT JOIN `cases` ON `expenses`.`expense_type` = `1` && expenses.expense_case_ref_id = cases.case_ref_id WHERE `dopuex_donation_id` = '34' GROUP BY `cases`.`case_name`
он рассматривает значение 1 как поле .. как я могу это исправить?