WIN-2308041133\Administrator 7 months ago
parent
commit
ca0bedc6c7
1 changed files with 6 additions and 0 deletions
  1. 6 0
      app/api/controller/user/UserExtractController.php

+ 6 - 0
app/api/controller/user/UserExtractController.php

@@ -57,6 +57,7 @@ class UserExtractController
         $data['minPrice'] = sys_config('user_extract_min_price');//提现最低金额
         $data['extractInfo'] = UserExtract::userLastInfo($user['uid']);
         $data['extract_commission'] = sys_config('extract_commission', 0);
+
         return app('json')->successful($data);
     }
 
@@ -99,6 +100,11 @@ class UserExtractController
         if ($data['broken_commission'] < 0)
             $data['broken_commission'] = 0;
         $data['brokerage_price'] = $user['brokerage_price'];
+        $retention_money = sys_config('retention_money', 0);  //健康币最低保留金额
+        $brokerage_price = bcsub($user['brokerage_price'], $data['money'], 2);
+        if ($brokerage_price < $retention_money){
+            return app('json')->fail('提现后健康币不能低于'. $retention_money);
+        }
         //可提现佣金
         $commissionCount = $data['brokerage_price'] - $data['broken_commission'];
         if ($extractInfo['money'] > $commissionCount) return app('json')->fail('可提现佣金不足');