codeigniter获得两个相同值的位置

时间:2015-06-27 09:42:04

标签: codeigniter

我们希望来自sales表的搜索数据,payment_status正在等待处理。我试试 -

$request->getParam('Email', 'default_value')

它运作良好,但是当我们想要搜索payment_status的值时,等待&部分同时它不起作用。我试试这段代码 -

$this->datatables
        ->select("id, date, reference_no, biller, customer, sale_status")
        ->from('sales')
        ->where('due_date <=', date('Y-m-d'))
        ->where('payment_status =', 'pending')

1 个答案:

答案 0 :(得分:2)

使用or_where

$this->datatables
        ->select("id, date, reference_no, biller, customer, sale_status, grand_total, paid, (grand_total-paid) as balance, payment_status")
        ->from('sales')
        ->where('due_date <=', date('Y-m-d'))
        ->where('payment_status =', 'pending')
        ->or_where('payment_status =', 'partial');

它让你条件where (payment_status ='pending' OR payment_status ='partial' )