laravel框架的whereIn条件或者where条件里面的in条件怎么写

1、第一种就是文档中标注的

 $where[] = ['in'=>['tn_user_base.id'=>$medical_number_ids]];

2、第二种 数组方式

$where[] = ['in'=>['tn_user_base.id'=>$medical_number_ids]];
  1. 他匹配的都是数组
  2. $condition[] =['check_doctor_uid','in',$check_doctor_id]; // 这是错误的写法
  3. //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) 这种写法有问题
  4.  

3、可以用when方法去写 

你可能感兴趣的:(php,laravel,where,in,whereIn)