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方法去寫