🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
一下使用无效的 ``` $where[] = ['id','in',[1,2]]; $where[] = ['in'=>['tn_user_base.id'=>$medical_number_ids]]; $where[] = ['in'=>['tn_user_base.id'=>$medical_number_ids]]; ``` **外部定义whereIn的用法** 1,表达式: ``` $whereOr[] = [Db::Raw("id in (" . join(',',[1,2,3]) . ')'),1]; ``` 输出:id in (1,2,3) = 1 破坏索引 2,闭包: ``` if (!empty($id)) { $where[] = [ function ($query) use ($id) { $query->whereIn('id', $id); }, ]; ```