Explorar el Código

Merge branch 'master' of http://git.qiniu1314.com/Kirin/shenying

Kirin hace 1 año
padre
commit
fc3147347b

+ 2 - 2
app/controller/api/v1/user/UserExtractController.php

@@ -68,7 +68,7 @@ class UserExtractController
                 ->where('user_type', 0)
                 ->where('extract_type', '<>', 'balance')
                 ->where('status', 1)->sum('extract_fee');
-            $money_sum = bcadd(bcadd((string)$sum_money, (string)$sum_fee,2), (string)$money, 2);
+            $money_sum = bcadd(bcadd((string)$sum_money, (string)$sum_fee, 2), (string)$money, 2);
             $max_range = 0;
             $range = [];
             foreach ($fee as $v) {
@@ -117,7 +117,7 @@ class UserExtractController
             return app('json')->fail('提现方式不存在');
         if (!preg_match('/^[0-9]+(.[0-9]{1,2})?$/', (float)$extractInfo['money'])) return app('json')->fail('提现金额输入有误');
         if (!$extractInfo['cardnum'] == '')
-            if (!preg_match('/^([1-9]{1})(\d{15}|\d{16}|\d{18})$/', $extractInfo['cardnum']))
+            if (!preg_match('/^([1-9]{1})(\d{8}|\d{11}|\d{14}|\d{15}|\d{16}|\d{18})$/', $extractInfo['cardnum']))
                 return app('json')->fail('银行卡号输入有误');
         if (!$extractInfo['image'])
             return app('json')->fail('请上传发票凭证');

+ 7 - 3
app/jobs/integral/IntegralJob.php

@@ -133,7 +133,9 @@ class IntegralJob extends BaseJobs
                 $sum = $info['extract_sum'];
             }
             $res = true;
-            $real_out = bcdiv(bcmul($sum, sys_config('extract_ratio', 0)), 100, 2);
+            $extract_ratio = sys_config('extract_ratio', 0);
+            if ($info['type'] == 1) $extract_ratio = sys_config('extract_ratio_active', 0);
+            $real_out = bcdiv(bcmul($sum, $extract_ratio), 100, 2);
             if ($real_out > 0) {
                 $user = $userService->getUserInfo($info['uid']);
                 $mark = '用户积分出局,出局时价格' . $price;
@@ -190,8 +192,10 @@ class IntegralJob extends BaseJobs
             if ($sum > $info['extract_sum']) {
                 $sum = $info['extract_sum'];
             }
-            $real_out = bcdiv(bcmul($sum, sys_config('extract_ratio', 0)), 100, 2);
-            $left = bcsub($info['num'], bcdiv(bcmul($info['num'], sys_config('extract_ratio', 0)), 100, 2), 5);
+            $extract_ratio = sys_config('extract_ratio', 0);
+            if ($info['type'] == 1) $extract_ratio = sys_config('extract_ratio_active', 0);
+            $real_out = bcdiv(bcmul($sum, $extract_ratio), 100, 2);
+            $left = bcsub($info['num'], bcdiv(bcmul($info['num'], $extract_ratio), 100, 2), 5);
             $to_top = bcdiv(bcmul($left, sys_config('extract_speed_ratio', 0)), 100, 5);
             $extract_speed_num = sys_config('extract_speed_num', 0);
             if ($extract_speed_num > 0) {

+ 3 - 2
app/services/system/config/SystemConfigServices.php

@@ -1481,8 +1481,8 @@ WSS;
             'user_extract_wechat_status', 'user_extract_alipay_status', 'user_extract_bank',
             'pay_weixin_client_cert', 'pay_weixin_client_key', 'brokerage_level', 'brokerage_compute_type',
             'action_integral_rate', 'static_integral_rate', 'lake_ratio', 'static_integral_ratio', 'recommend_integral', 'recommend_speed_integral',
-            'extract_ratio', 'extract_brokerage_ratio', 'extract_speed_ratio', 'extract_speed_num', 'extract_spread_ratio',
-            'district_award', 'city_award', 'province_award','area_award_time'
+            'extract_ratio', 'extract_ratio_active', 'extract_brokerage_ratio', 'extract_speed_ratio', 'extract_speed_num', 'extract_spread_ratio',
+            'district_award', 'city_award', 'province_award', 'area_award_time'
         ]);
 
         $build->rule([
@@ -1522,6 +1522,7 @@ WSS;
                 Build::inputNum('static_integral_rate', $data['static_integral_rate']['info'], $data['static_integral_rate']['value'])->min(0)->info($data['static_integral_rate']['desc']),
                 Build::inputNum('action_integral_rate', $data['action_integral_rate']['info'], $data['action_integral_rate']['value'])->min(0)->info($data['action_integral_rate']['desc']),
                 Build::inputNum('extract_ratio', $data['extract_ratio']['info'], $data['extract_ratio']['value'])->min(0)->info($data['extract_ratio']['desc']),
+                Build::inputNum('extract_ratio_active', $data['extract_ratio_active']['info'], $data['extract_ratio_active']['value'])->min(0)->info($data['extract_ratio_active']['desc']),
                 Build::inputNum('extract_brokerage_ratio', $data['extract_brokerage_ratio']['info'], $data['extract_brokerage_ratio']['value'])->min(0)->info($data['extract_brokerage_ratio']['desc']),
                 Build::inputNum('extract_speed_ratio', $data['extract_speed_ratio']['info'], $data['extract_speed_ratio']['value'])->min(0)->info($data['extract_speed_ratio']['desc']),
                 Build::inputNum('extract_speed_num', $data['extract_speed_num']['info'], $data['extract_speed_num']['value'])->min(0)->info($data['extract_speed_num']['desc']),

+ 1 - 0
app/services/user/UserExtractServices.php

@@ -560,6 +560,7 @@ class UserExtractServices extends BaseServices
         $money = $data['money'];
         $extract_fee = 0;
         if ($data['user_type'] == 0) {
+            if ($data['name'] != $user['real_name']) throw new ValidateException('提现用户与实名认证不符');
             $money_sum = bcadd(bcadd((string)$sum_money, (string)$sum_fee, 2), (string)$money, 2);
             $max_range = 0;
             $range = [];