Guys how can I apply an OR condition in the following Where statement ?
$this->IbCommisions->find()->matching(
'Users.Accounts',function ($q) {
return $q->where(['IbCommisions.ib_id' => $this->userid, 'Users.country_id' => $this->request->data['country']]);
}
To become something like
(['IbCommisions.ib_id' => $this->userid OR 'Users.country_id' => $this->request->data['country']])
return $q->where(['OR' => [
'IbCommisions.ib_id' => $this->userid,
'Users.country_id' => $this->request->data['country']
]]);
or alternatively
return $q->where(['IbCommisions.ib_id' => $this->userid])
->orWhere(['Users.country_id' => $this->request->data['country']]);
http://book.cakephp.org/3.0/en/orm/query-builder.html#advanced-conditions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With