with能调用本身内容作为条件吗?
表如图!我查出所有user表数据并关联attr
User::with('getAttr')->get();
但是我需要根据user当前的type来获取attr的值!怎么在with里面操作?
$user = User::with(['getAttr'=>function($q){
$q->where('type',??);
}])->get();
github.com/topclaudy/compoships