mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进关联查询预载入 支持闭包使用条件之外的连贯操作
This commit is contained in:
@@ -339,7 +339,10 @@ class Relation
|
||||
{
|
||||
$foreignKey = $this->foreignKey;
|
||||
// 预载入关联查询 支持嵌套预载入
|
||||
$list = $model->where($where)->where($closure)->with($subRelation)->select();
|
||||
if ($closure) {
|
||||
call_user_func_array($closure, [ & $model]);
|
||||
}
|
||||
$list = $model->where($where)->with($subRelation)->select();
|
||||
|
||||
// 组装模型数据
|
||||
$data = [];
|
||||
|
||||
Reference in New Issue
Block a user