diff --git a/app/Service/ServiceTrait/Api/OrderTrait.php b/app/Service/ServiceTrait/Api/OrderTrait.php index dca651e..c1fff70 100644 --- a/app/Service/ServiceTrait/Api/OrderTrait.php +++ b/app/Service/ServiceTrait/Api/OrderTrait.php @@ -375,7 +375,7 @@ trait OrderTrait { if ($this->couponId <= 0) return; - $couponInfo = $this->userCouponModel->where('coupon_id', $this->couponId)->where('user_id',$this->userId)->first(); + $couponInfo = $this->userCouponModel->where('id', $this->couponId)->where('user_id',$this->userId)->first(); if (empty($couponInfo)) throw new ErrException('优惠券信息错误'); if (in_array($couponInfo->status,[CouponCode::COUPON_STATUS_USED,CouponCode::COUPON_STATUS_EXPIRE])) throw new ErrException('优惠券已经被使用');