1、第一种就是文档中标注的
$where[] = ['in'=>['tn_user_base.id'=>$medical_number_ids]];
2、第二种 数组方式
$where[] = ['in'=>['tn_user_base.id'=>$medical_number_ids]];
- 他匹配的都是数组
-
$condition[] =['check_doctor_uid','in',$check_doctor_id]; // 这是错误的写法
-
//in查询应该用whereIn
$condition[] =['check_doctor_uid','in',$check_doctor_id]; // 错误
// Illuminate\Database\Query\Builder关于operators定义中,并没有in
public $operators = [
'=', '<', '>', '<=', '>=', '<>', '!=',
'like', 'like binary', 'not like', 'between', 'ilike',
'&', '|', '^', '<<', '>>',
'rlike', 'regexp', 'not regexp',
'~', '~*', '!~', '!~*', 'similar to',
'not similar to', 'not ilike', '~~*', '!~~*',
];
//->where($condition) 这种写法有问题
-
3、可以用when方法去写