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++; }