Bladeren bron

提现额度-原来只有共富区有提现额度,现需要全平台消费都发放提现额度,把提现额度从共富区奖励表拆出,单独建表;

sunxbiao 5 maanden geleden
bovenliggende
commit
6a099583c6
1 gewijzigde bestanden met toevoegingen van 8 en 0 verwijderingen
  1. 8 0
      app/controller/api/user/UserExtract.php

+ 8 - 0
app/controller/api/user/UserExtract.php

@@ -11,6 +11,7 @@ namespace app\controller\api\user;
11
 
11
 
12
 use alipay\aop\AopCertClient;
12
 use alipay\aop\AopCertClient;
13
 use alipay\aop\AopClient;
13
 use alipay\aop\AopClient;
14
+use app\common\repositories\user\UserRepository;
14
 use app\controller\api\Auth;
15
 use app\controller\api\Auth;
15
 use crmeb\basic\BaseController;
16
 use crmeb\basic\BaseController;
16
 use app\common\repositories\system\groupData\GroupDataRepository;
17
 use app\common\repositories\system\groupData\GroupDataRepository;
@@ -90,6 +91,13 @@ class UserExtract extends BaseController
90
 
91
 
91
         if (!$data['extract_price']) return app('json')->fail('请输入提现金额');
92
         if (!$data['extract_price']) return app('json')->fail('请输入提现金额');
92
 
93
 
94
+        /** @var UserRepository $userRepository */
95
+        $userRepository = app()->make(UserRepository::class);
96
+        $userEntity = $userRepository->getUserEntityByUid($uid);
97
+        if (empty($userEntity->getWithdrawalLimit()) || $userEntity->getWithdrawalLimit() < $data['extract_price']) {
98
+            return app('json')->fail('可提现额度不足');
99
+        }
100
+
93
         if ($type == 1) {
101
         if ($type == 1) {
94
             if ($data['extract_price'] < (systemConfig('withdrawal_money')))
102
             if ($data['extract_price'] < (systemConfig('withdrawal_money')))
95
                 return app('json')->fail('未到达提现最低额度');
103
                 return app('json')->fail('未到达提现最低额度');