feat : config

This commit is contained in:
2025-03-20 16:41:35 +08:00
parent 66632af855
commit 28e0430043

View File

@@ -375,7 +375,7 @@ trait OrderTrait
{ {
if ($this->couponId <= 0) return; 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 (empty($couponInfo)) throw new ErrException('优惠券信息错误');
if (in_array($couponInfo->status,[CouponCode::COUPON_STATUS_USED,CouponCode::COUPON_STATUS_EXPIRE])) throw new ErrException('优惠券已经被使用'); if (in_array($couponInfo->status,[CouponCode::COUPON_STATUS_USED,CouponCode::COUPON_STATUS_EXPIRE])) throw new ErrException('优惠券已经被使用');