mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
Collection::append() 判断数据是否存在(null)
调用collection()->append(['关联'=>['属性']]),如果遇到某个模型对象的关联查询到null,则append会导致null object错误
This commit is contained in:
@@ -85,7 +85,7 @@ class Collection extends BaseCollection
|
|||||||
{
|
{
|
||||||
$this->each(function ($model) use ($append, $override) {
|
$this->each(function ($model) use ($append, $override) {
|
||||||
/** @var Model $model */
|
/** @var Model $model */
|
||||||
$model->append($append, $override);
|
$model && $model->append($append, $override);
|
||||||
});
|
});
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user