WIN-2308041133\Administrator 1 ماه پیش
والد
کامیت
a8f5a98535
1فایلهای تغییر یافته به همراه6 افزوده شده و 1 حذف شده
  1. 6 1
      app/common/repositories/user/AwardIntegralPriceRepository.php

+ 6 - 1
app/common/repositories/user/AwardIntegralPriceRepository.php

@@ -210,6 +210,9 @@ class AwardIntegralPriceRepository extends BaseRepository
 
 
                         $make = app()->make(UserBillRepository::class);
                         $make = app()->make(UserBillRepository::class);
                         $userRepository = app()->make(UserRepository::class);
                         $userRepository = app()->make(UserRepository::class);
+                        if (bcsub($user['award_range'], $down_range, 2) <= 0){
+                            continue;
+                        }
                         $make->decBill($item['uid'], 'award_range', 'extract_award', [
                         $make->decBill($item['uid'], 'award_range', 'extract_award', [
                             'link_id' => $item['order_id'],
                             'link_id' => $item['order_id'],
                             'status' => 1,
                             'status' => 1,
@@ -219,7 +222,9 @@ class AwardIntegralPriceRepository extends BaseRepository
                             'balance' => bcsub($user['award_range'], $down_range, 2)
                             'balance' => bcsub($user['award_range'], $down_range, 2)
                         ]);
                         ]);
                         $userRepository->decField($item['uid'], 'award_range', $down_range);
                         $userRepository->decField($item['uid'], 'award_range', $down_range);
-
+                        if (bcsub($user['award_integral'], $award_integral, 2) <= 0){
+                            continue;
+                        }
                         $make->decBill($item['uid'], 'award_integral', 'extract_award', [
                         $make->decBill($item['uid'], 'award_integral', 'extract_award', [
                             'link_id' => $item['order_id'],
                             'link_id' => $item['order_id'],
                             'status' => 1,
                             'status' => 1,