注册 登录
  • 欢迎访问开心洋葱网站,在线教程,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站,欢迎加入开心洋葱 QQ群
  • 欢迎访问开心洋葱网站,手机也能访问哦~欢迎加入开心洋葱多维思维学习平台 QQ群
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏开心洋葱吧~~~~~~~~~~~~~!

yii框架高级In查询写法

PHP 开心洋葱 3412次浏览 已收录 0个评论 手机上查看

yii框架高级In查询写法

注意:本段内容须成功“回复本文”后“刷新本页”方可查看!

  $userModel = (new \yii\db\Query())->from(User::tableName())->where(['=','id',$userID])->andWhere(['=','post','BranchManager'])->one();
            if (false){
                $userGroup = (new \yii\db\Query())->from(User::tableName())->where(['=','department',$userModel['department']])->all();
                $userIdArr = [];
                $userIdArrS = [];
                foreach ($userGroup as $k => $v) {
                    $userIdArr[]=$v['id'];
                    $userIdArrS[]=','.$v['id'].',';
                }
                $where_userid =  ['or',['or like','pi.pre_evaluation',$userIdArrS],['or like','pi.leader',$userIdArr],['or like','pi.due_diligence',$userIdArrS],['or like','pi.zongjian',$userIdArrS]];
            }else{
                $where_userid = "pi.pre_evaluation like '%,$userID,%' or pi.leader like '%$userID%'  or pi.leader like '%,$userID,%' or pi.due_diligence like '%,$userID,%' or pi.zongjian like '%,$userID,%' or pi.zongjian='$userID' ";
            }


开心洋葱 , 版权所有丨如未注明 , 均为原创丨未经授权请勿修改 , 转载请注明yii框架高级In查询写法
喜欢 (0)
[开心洋葱]
分享 (0)
关于作者:
开心洋葱,开心洋葱头,水墨

您必须 登录 才能发表评论!

加载中……