From a1771b455c80e6093a9a3013cf35f04d6470e11a Mon Sep 17 00:00:00 2001 From: ztt <835303992@qq.com> Date: Mon, 26 Feb 2024 14:11:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=94=AE=E5=90=8E=E5=8D=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/model/OrderRefund.php | 6 +++--- app/store/model/OrderRefund.php | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) 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')