tp5where和whereor冲突后的解决方法

    if ( session('user.username') == 'admin'){

        $this->_query($this->applies)->like('title')->where($where)->where('status','in',[1,2])->order('user_number','desc')->page('1');

    }else{

        $this->_query($this->applies)->like('title')->where($where)->where($where1)->where('status','in',[1,2])->order('user_number','desc')->page();

    }



    将whereor换成where('id','in',[1.2])
    此方法适用于字段相同的多where条件

你可能感兴趣的:(tp5where和whereor冲突后的解决方法)