优化售后单列表数据结构

wxl
ztt 9 months ago
parent 48c7f8cf32
commit 2e13cb8fba
  1. 9
      app/common/model/OrderRefund.php
  2. 2
      app/store/model/OrderRefund.php

@ -57,6 +57,15 @@ class OrderRefund extends BaseModel
return $this->belongsTo('OrderGoods')->withoutField(['content']);
}
/**
* 关联订单商品表
* @return BelongsTo
*/
public function goods(): BelongsTo
{
return $this->belongsTo('OrderGoods')->withoutField(['content']);
}
/**
* 关联图片记录表
* @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']);
}
/**

Loading…
Cancel
Save