@ -59,11 +59,11 @@ class OrderRefund extends BaseModel
/**
* 关联订单商品表
* @return BelongsTo
* @return HasMany
*/
public function goods(): BelongsTo
public function goods(): HasMany
{
return $this->belongsTo('OrderGoods')->withoutField(['content']);
return $this->hasMany('OrderGoods', 'order_id', 'order_id')->withoutField(['content']);
}
@ -88,7 +88,8 @@ class OrderRefund extends OrderRefundModel
// 获取列表数据
$query = $this->alias('refund')
$query = $this
->alias('refund')
->field('refund.*, order.order_no')
->join('order', 'order.order_id = refund.order_id')
->join('user', 'user.user_id = order.user_id')