Quantcast
Viewing latest article 13
Browse Latest Browse All 60

Yii2 query / query builder: how to use OR condition


Yii2 query / query builder: how to use OR condition


You can use some thing like this:

$third_res_count=CustomerReservedTimeslots::find()
    ->select(['COUNT(timeslot_id) AS cnt'])
    ->where([
'test_date'=> $today_date,
'confirmed'=> '1',
    ])
    ->andWhere(['>', 'third_user_id', '0'])
    ->andFilterWhere([
'or',
        ['like', 'status', 'checked in'],
        ['like', 'status', 'Waiting for check in'],
    ])
    ->one();


Viewing latest article 13
Browse Latest Browse All 60

Trending Articles