mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
一对一预载入 In查询方式兼容withField方法
This commit is contained in:
@@ -267,6 +267,10 @@ abstract class OneToOne extends Relation
|
|||||||
// 预载入关联查询 支持嵌套预载入
|
// 预载入关联查询 支持嵌套预载入
|
||||||
if ($closure) {
|
if ($closure) {
|
||||||
call_user_func_array($closure, [ & $model]);
|
call_user_func_array($closure, [ & $model]);
|
||||||
|
if ($model->getOptions('with_field')) {
|
||||||
|
$model->field($model->getOptions('with_field'));
|
||||||
|
$model->removeOption('with_field');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$list = $model->where($where)->with($subRelation)->select();
|
$list = $model->where($where)->with($subRelation)->select();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user