diff --git a/app/common/model/OrderRefund.php b/app/common/model/OrderRefund.php index d245b3d0..f43abb32 100644 --- a/app/common/model/OrderRefund.php +++ b/app/common/model/OrderRefund.php @@ -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']); } /** diff --git a/app/store/model/OrderRefund.php b/app/store/model/OrderRefund.php index f9d4b898..3c37a734 100644 --- a/app/store/model/OrderRefund.php +++ b/app/store/model/OrderRefund.php @@ -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')