修改增收补贴发放的错误
This commit is contained in:
parent
6874dab755
commit
d1896638d5
@ -34,9 +34,9 @@ class SendSubsidyCouponListen extends TimerService implements ListenerInterface
|
|||||||
->select();
|
->select();
|
||||||
foreach ($merchants as $merchant) {
|
foreach ($merchants as $merchant) {
|
||||||
//商户已获得的补贴金额
|
//商户已获得的补贴金额
|
||||||
$gotSubsidy = StoreCouponUser::where('coupon_id', $coupon['coupon_id'])
|
$gotSubsidy = StoreCouponDetail::where('coupon_id', $coupon['coupon_id'])
|
||||||
->where('uid', $merchant->uid)
|
->where('uid', $merchant->uid)
|
||||||
->value('origin_price');
|
->sum('amount');
|
||||||
if ($gotSubsidy >= $item['subsidy']) {
|
if ($gotSubsidy >= $item['subsidy']) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ class SendSubsidyCouponListen extends TimerService implements ListenerInterface
|
|||||||
/** @var StoreCouponUserRepository $userCouponRepo */
|
/** @var StoreCouponUserRepository $userCouponRepo */
|
||||||
$userCouponRepo = app()->make(StoreCouponUserRepository::class);
|
$userCouponRepo = app()->make(StoreCouponUserRepository::class);
|
||||||
$coupon->coupon_price = $amount;
|
$coupon->coupon_price = $amount;
|
||||||
$userCouponRepo->status = StoreCouponUser::STATUS_REPEAL;
|
$userCouponRepo->status = StoreCouponDetail::STATUS_INVALID;
|
||||||
$userCouponRepo->uid = $merchant['uid'];
|
$userCouponRepo->uid = $merchant['uid'];
|
||||||
$userCouponRepo->coupon = $coupon;
|
$userCouponRepo->coupon = $coupon;
|
||||||
$userCouponRepo->order = ['uid' => $merchant['uid'],];
|
$userCouponRepo->order = ['uid' => $merchant['uid'],];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user