From 6874dab755c10761c88b5d3fa4f584e46a27fbb7 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Fri, 22 Mar 2024 14:52:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A2=9E=E6=94=B6=E8=A1=A5?= =?UTF-8?q?=E8=B4=B4=E5=8F=91=E6=94=BE=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repositories/store/coupon/StoreCouponUserRepository.php | 1 + crmeb/listens/SendSubsidyCouponListen.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/common/repositories/store/coupon/StoreCouponUserRepository.php b/app/common/repositories/store/coupon/StoreCouponUserRepository.php index 4c24039a..da7011c2 100644 --- a/app/common/repositories/store/coupon/StoreCouponUserRepository.php +++ b/app/common/repositories/store/coupon/StoreCouponUserRepository.php @@ -220,6 +220,7 @@ class StoreCouponUserRepository extends BaseRepository return $model; } catch (\Exception $e) { Db::rollback(); + throw new \Exception($e->getMessage()); } } diff --git a/crmeb/listens/SendSubsidyCouponListen.php b/crmeb/listens/SendSubsidyCouponListen.php index 9c5592d4..a01870e3 100644 --- a/crmeb/listens/SendSubsidyCouponListen.php +++ b/crmeb/listens/SendSubsidyCouponListen.php @@ -46,6 +46,7 @@ class SendSubsidyCouponListen extends TimerService implements ListenerInterface $userCouponRepo = app()->make(StoreCouponUserRepository::class); $coupon->coupon_price = $amount; $userCouponRepo->status = StoreCouponUser::STATUS_REPEAL; + $userCouponRepo->uid = $merchant['uid']; $userCouponRepo->coupon = $coupon; $userCouponRepo->order = ['uid' => $merchant['uid'],]; $userCouponRepo->extra = [ @@ -57,6 +58,7 @@ class SendSubsidyCouponListen extends TimerService implements ListenerInterface $userCouponRepo->onlyDetail = true; $userCouponRepo->detailStatus = StoreCouponDetail::STATUS_INVALID; $userCouponRepo->sendStatus = StoreCouponDetail::SEND_REPEAL; + $userCouponRepo->sendType = StoreCouponUserRepository::SEND_TYPE_SEND; $userCouponRepo->send(); $count++; }