@ -57,6 +57,15 @@ class OrderRefund extends BaseModel
return $this->belongsTo('OrderGoods')->withoutField(['content']);
}
/**
* 关联订单商品表
* @return BelongsTo
*/
public function goods(): BelongsTo
{
* 关联图片记录表
* @return HasMany
@ -100,7 +100,7 @@ class OrderRefund extends OrderRefundModel
$list = $query->order(['refund.create_time' => 'desc', 'refund.' . $this->getPk()])
->paginate(10);
// 加载关联订单数据
return static::preload($list, ['orderGoods.image', 'orderData', 'user.avatar']);
return static::preload($list, ['goods.image', 'orderData', 'user.avatar']);