我的查询有问题
当我像下面这样运行它时,我得到所有组织的所有组和项(表项)。它的意思是只从
org_id
以及它们可见的地方。
return $this->model->with( [ 'items' => function($query){$query->where('invisible','=',FALSE)->orWhere('invisible', '=', null)->orderBy('description', 'ASC');} ] )->where("org_id",$org_id)->where('invisible','=',FALSE)->orWhere('invisible', '=', null)->orderBy('description', 'asc')->get();
如果我像这样运行
invisible
查询组)工作正常。
return $this->model->with( [ 'items' => function($query){$query->where('invisible','=',FALSE)->orWhere('invisible', '=', null)->orderBy('description', 'ASC');} ] )->where("hos_id",$hos_id)->orderBy('description', 'asc')->get();
我该怎么做
WHERE orf_id= org_id
AND ( invisible = false OR invisible = NULL )