modify and add one more condition in controller with cakephp -
i have condition in controller listing products 1 table
$conditions = array('winner_id >' => 0, 'product.beg' => '1', 'product.status_id' => $status_id);
i need add 1 more condition here check winner have paid also. have 1 more table accounts, , have winner id in products table. how add condition here check winners id in accounts table in same condition.
need add 1 condition more, take winner_id product table , search in accounts table, , show id's there in accounts table
i tried way not working:
$conditions = array('winner_id >' => 0, 'product.beg' => '1', 'product.status_id' => $status_id, array('conditions' => array('product.winner_id' => $this->'account.user_id')));
if based on if
condition want add condition
help.. correct me if have missed something.
if(condition) { $conditions + = array('field_name' => 'field_value'); }
Comments
Post a Comment