From 6eb8019119d686760a4a32c8242c752183eeaec6 Mon Sep 17 00:00:00 2001 From: "DESKTOP-GG6FIN9\\Administrator" <15040771@qq.com> Date: Fri, 7 Aug 2020 18:24:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=94=E5=88=B8=20=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Amqp/Consumer/couponRebateConsumer.php | 2 +- app/Service/CouponRebateService.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Amqp/Consumer/couponRebateConsumer.php b/app/Amqp/Consumer/couponRebateConsumer.php index e04615e..239aee7 100644 --- a/app/Amqp/Consumer/couponRebateConsumer.php +++ b/app/Amqp/Consumer/couponRebateConsumer.php @@ -33,7 +33,7 @@ class couponRebateConsumer extends ConsumerMessage //var_dump($message->getBody()); $res = $this->CouponRebateService->couponRebate($data); //var_dump($res); - if (false) { + if (!$res) { return Result::REQUEUE; } return Result::ACK; diff --git a/app/Service/CouponRebateService.php b/app/Service/CouponRebateService.php index cc65a8e..233a4ae 100644 --- a/app/Service/CouponRebateService.php +++ b/app/Service/CouponRebateService.php @@ -255,7 +255,8 @@ class CouponRebateService implements CouponRebateServiceInterface ->whereRaw('inventory > inventory_use') ->exists(); if(!$inventory){ - return '库存不足'; + //库存不足 + return false; } //获取活动发放优惠券id @@ -365,7 +366,7 @@ class CouponRebateService implements CouponRebateServiceInterface LogLabel::COUPON_LOG, $log_Data ); - return '返券成功'; + return true; } /**