laravel框架的whereIn条件或者where条件里面的in条件怎么写
程序员文章站
2024-03-02 13:05:34
...
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方法去写
上一篇: CSS中的滑动门技术
下一篇: Java中String性能优化