thinkphp5关联预载入with指定字段属性查询
如果要指定属性查询,可以使用:
$list = User::with(['profile' => function($query){ $query->withField('truename,email'); }])->select([1,2,3]);
如果要指定属性查询,可以使用:
$list = User::with(['profile' => function($query){ $query->withField('truename,email'); }])->select([1,2,3]);