Просмотр исходного кода

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

sunxbiao месяцев назад: 5
Родитель
Сommit
6a099583c6
1 измененных файлов с 8 добавлено и 0 удалено
  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 12
 use alipay\aop\AopCertClient;
13 13
 use alipay\aop\AopClient;
14
+use app\common\repositories\user\UserRepository;
14 15
 use app\controller\api\Auth;
15 16
 use crmeb\basic\BaseController;
16 17
 use app\common\repositories\system\groupData\GroupDataRepository;
@@ -90,6 +91,13 @@ class UserExtract extends BaseController
90 91
 
91 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 101
         if ($type == 1) {
94 102
             if ($data['extract_price'] < (systemConfig('withdrawal_money')))
95 103
                 return app('json')->fail('未到达提现最低额度');