闭包查询方法提示查询表达式错误:3

浏览:2548 发布日期:2018/01/19 分类:求助交流 关键字: where whereOr 闭包 tp5
//卡券列表
        $map = function($query)use($lessonInfo){
            $query->where(['target_type'=>1,'publish_start'=>['lt',time()],'publish_end'=>['gt',time()],'is_max'=>1,'target_id'=>0])
            ->whereOr(['target_type'=>3,'publish_start'=>['lt',time()],'publish_end'=>['gt',time()],'is_max'=>1])
            ->whereOr(['target_type'=>1,'publish_start'=>['lt',time()],'publish_end'=>['gt',time()],'is_max'=>1,'target_id'=>$lessonInfo['id']])
            ;
        };
        // dump($map);die;
        // 卡券系统        
        $ItemCoupon = new \app\model\ItemCoupon;
        // 平台卡券
        $couponListOfSystem = $ItemCoupon->where($map)->where(['organization_type'=>1])->select();
最佳答案
评论( 相关
后面还有条评论,点击查看>>