TP5关联闭包查询

        $newList = $this->cate1Model->with(["cate2"=>function($query){
            $query->where('switch','1')->order('weigh asc');
        }])->where('switch','1')->order('weigh asc')->select();

 

posted @ 2022-04-16 08:53  一颗糊涂淡  阅读(341)  评论(0编辑  收藏  举报