在codeigniter中使用CONCAT的多重条件

时间:2016-11-14 09:55:06

标签: php codeigniter codeigniter-3

iam使用concat函数但是我不能在这个函数中使用多个条件,只有一个条件允许我在检查我的结果时,请帮助我并给出核心分辨率,我的代码如下...

$this->db->select("pay_status,pay_invoiceid,GROUP_CONCAT(
                     CONCAT (jil_payment.pay_id,'-',jil_payment.pay_amount,IF ( 
                       jil_payment.pay_status='4','(submited)' 
                       AND jil_payment.pay_status='2','(deposited)'))) as paymentdetail");

1 个答案:

答案 0 :(得分:0)

尝试添加FALSE arg,如下所示:

$this->db->select("pay_status,pay_invoiceid,GROUP_CONCAT(
                   CONCAT (jil_payment.pay_id,'-',jil_payment.pay_amount,IF ( 
                   jil_payment.pay_status='4','(submited)' 
                   AND jil_payment.pay_status='2','(deposited)'))) as paymentdetail", FALSE);