|
@@ -59,16 +59,19 @@ class UserExtractController
|
|
->where('extract_type', '<>', 'balance')
|
|
->where('extract_type', '<>', 'balance')
|
|
->where('status', 1)->sum('extract_price');
|
|
->where('status', 1)->sum('extract_price');
|
|
$money = $request->post('money');
|
|
$money = $request->post('money');
|
|
|
|
+ $user_type = $request->post('user_type', 0);
|
|
$extract_fee = 0;
|
|
$extract_fee = 0;
|
|
- $max = PHP_INT_MAX;
|
|
|
|
- foreach ($fees as $k => $v) {
|
|
|
|
- if ($sum_money > $max) {
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- $max = $k;
|
|
|
|
- if ($sum_money + $money > $k) {
|
|
|
|
- $extract_fee = bcadd((string)$extract_fee, bcmul((string)($sum_money + $money - ($sum_money > $k ? $sum_money : $k)), bcdiv($v, '100', 4), 2));
|
|
|
|
- $money = $money - ($sum_money + $money - $k);
|
|
|
|
|
|
+ if ($user_type == 0) {
|
|
|
|
+ $max = PHP_INT_MAX;
|
|
|
|
+ foreach ($fees as $k => $v) {
|
|
|
|
+ if ($sum_money > $max) {
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ $max = $k;
|
|
|
|
+ if ($sum_money + $money > $k) {
|
|
|
|
+ $extract_fee = bcadd((string)$extract_fee, bcmul((string)($sum_money + $money - ($sum_money > $k ? $sum_money : $k)), bcdiv($v, '100', 4), 2));
|
|
|
|
+ $money = $money - ($sum_money + $money - $k);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return app('json')->success('ok', ['fee' => $extract_fee]);
|
|
return app('json')->success('ok', ['fee' => $extract_fee]);
|
|
@@ -91,6 +94,7 @@ class UserExtractController
|
|
['cardnum', ''],
|
|
['cardnum', ''],
|
|
['weixin', ''],
|
|
['weixin', ''],
|
|
['qrcode_url', ''],
|
|
['qrcode_url', ''],
|
|
|
|
+ ['user_type', 0],
|
|
]);
|
|
]);
|
|
$extractType = Config::get('pay.extractType', []);
|
|
$extractType = Config::get('pay.extractType', []);
|
|
if (!in_array($extractInfo['extract_type'], $extractType))
|
|
if (!in_array($extractInfo['extract_type'], $extractType))
|