From d1896638d5ca5f311004cb6e1c17a3362c2ad2c6 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Fri, 22 Mar 2024 15:04:28 +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 --- crmeb/listens/SendSubsidyCouponListen.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crmeb/listens/SendSubsidyCouponListen.php b/crmeb/listens/SendSubsidyCouponListen.php index a01870e3..e34538b8 100644 --- a/crmeb/listens/SendSubsidyCouponListen.php +++ b/crmeb/listens/SendSubsidyCouponListen.php @@ -34,9 +34,9 @@ class SendSubsidyCouponListen extends TimerService implements ListenerInterface ->select(); foreach ($merchants as $merchant) { //商户已获得的补贴金额 - $gotSubsidy = StoreCouponUser::where('coupon_id', $coupon['coupon_id']) + $gotSubsidy = StoreCouponDetail::where('coupon_id', $coupon['coupon_id']) ->where('uid', $merchant->uid) - ->value('origin_price'); + ->sum('amount'); if ($gotSubsidy >= $item['subsidy']) { continue; } @@ -45,7 +45,7 @@ class SendSubsidyCouponListen extends TimerService implements ListenerInterface /** @var StoreCouponUserRepository $userCouponRepo */ $userCouponRepo = app()->make(StoreCouponUserRepository::class); $coupon->coupon_price = $amount; - $userCouponRepo->status = StoreCouponUser::STATUS_REPEAL; + $userCouponRepo->status = StoreCouponDetail::STATUS_INVALID; $userCouponRepo->uid = $merchant['uid']; $userCouponRepo->coupon = $coupon; $userCouponRepo->order = ['uid' => $merchant['uid'],];