1. //AND (`id`=1 AND `name`='2')
    2. $query->where(['id' => 1,'name' => '2']);
    3. //AND (`time` <= 1234567891)
    4. $query->where('time', '<=', 1234567891);
    5. //AND (`time` LIKE '%test%')
    6. $query->where('time', 'like', '%test%');
    7. //AND (`id` IN(1,2,3))
    8. $query->where(['id' => [1,2,3]]);
    9. //AND (FIND_IN_SET(1,`id`))
    10. $query->whereFindInSet('id', 1);
    1. //AND (`title` LIKE '%haha%' OR `name` LIKE '%haha%')
    2. $query->where('title|name', 'like', '%haha%');
    3. //AND (`time` >= 0 AND `date` >= 0)
    4. $query->where('time&date', '>=', 0);
    5. //AND (`name` LIKE '%think' OR `name` LIKE 'php%')
    6. $query->where('name', 'like', ['%think','php%'],'OR');
    1. //AND (`id` IN(1,2,3)) AND ((`name` LIKE '%think' OR `name` LIKE 'php%') OR `type_id` = 2)
    2. $orWhere = [
    3. ['name', 'like', ['%think','php%'], 'OR'],
    4. ['type_id', '=', 2],
    5. ];
    6. $query->where(['id' => [1,2,3]])
    7. ->where('name', 'like', ['%think','php%'],'OR')
    8. ->where((function ($query) use ($orWhere) {
    9. $query->whereOr($orWhere);
    10. }))