From b963308ea2a51a046a149ec32c3143819fa52d24 Mon Sep 17 00:00:00 2001 From: weigang Date: Sat, 10 Oct 2020 16:27:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8F=90=E7=8E=B0=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E5=92=8C=E6=98=AF=E5=90=A6=E7=A7=92=E5=88=B0=E8=B4=A6=E9=99=90?= =?UTF-8?q?=E5=88=B6=E6=94=B9=E4=B8=BA=E4=BB=8E=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/v3/WithdrawController.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/app/Controller/v3/WithdrawController.php b/app/Controller/v3/WithdrawController.php index 459b7c5..92d1abf 100644 --- a/app/Controller/v3/WithdrawController.php +++ b/app/Controller/v3/WithdrawController.php @@ -8,6 +8,7 @@ use App\Constants\v3\LogLabel; use App\Constants\v3\UserType; use App\Controller\BaseController; use App\Exception\ErrorCodeException; +use App\Model\SystemConfig; use App\Model\v3\FinancialRecord; use App\Model\v3\Store; use App\Model\v3\StoreWithdrawal; @@ -82,6 +83,10 @@ class WithdrawController extends BaseController [FinancialRecord::MONEY_TYPE_STORE_PLAT_NEW_USER, FinancialRecord::MONEY_TYPE_STORE_FIRST_ORDER] ); + $withdrawConfig = SystemConfig::query()->where(['category' => 5])->pluck('value', 'menu_name')->toArray(); + $min = $withdrawConfig['store_min_withdraw_amount'] ?? config('wechat.withdrawal.min_amount'); + $max = $withdrawConfig['store_max_withdraw_amount'] ?? config('wechat.withdrawal.max_amount'); + $data['notice'] = [ // [ // 'title' => '用户须知', @@ -89,7 +94,7 @@ class WithdrawController extends BaseController // ], [ 'title' => '提现须知', - 'content' => '

1、提金额最低为1元,最高为5000元,一天最多可提现10次。

' + 'content' => '

1、提金额最低为'.$min.'元,最高为'.$max.'元,一天最多可提现10次。

' .'

2、提现到账时间为一个工作日内。

' .'

3、提现成功后,提现款会自动转入您当前登录的微信账号

' .'

4、如果您在提现方面遇到问题,请致电联系我们的服务站。

' @@ -108,9 +113,15 @@ class WithdrawController extends BaseController public function applyByStore() { - $isDirect = config('wechat.withdrawal.is_direct'); - $min = config('wechat.withdrawal.min_amount'); - $max = config('wechat.withdrawal.max_amount'); + // $isDirect = config('wechat.withdrawal.is_direct'); + // $min = config('wechat.withdrawal.min_amount'); + // $max = config('wechat.withdrawal.max_amount'); + + $withdrawConfig = SystemConfig::query()->where(['category' => 5])->pluck('value', 'menu_name')->toArray(); + $isDirect = $withdrawConfig['store_withdraw_direct'] ?? config('wechat.withdrawal.is_direct'); + $min = $withdrawConfig['store_min_withdraw_amount'] ?? config('wechat.withdrawal.min_amount'); + $max = $withdrawConfig['store_max_withdraw_amount'] ?? config('wechat.withdrawal.max_amount'); + $validator = $this->validationFactory->make( $this->request->all(), [ @@ -128,7 +139,7 @@ class WithdrawController extends BaseController $userId = $this->request->input('user_id'); $storeId = $this->request->input('store_id'); - if ($money > 3000) { + if ($money > $max || $money < $min) { $this->log->event(LogLabel::STORE_WITHDRAW_FAIL_LOG, [ 'msg' => '提现失败[1000]', 'params' => json_encode(['money' => $money, 'user_id' => $userId, 'store_id' => $storeId]), From 08f9fbbc68525fc3fa714e02394fe332efc25dac Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Sat, 10 Oct 2020 17:02:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=8F=90=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/v3/WithdrawController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Controller/v3/WithdrawController.php b/app/Controller/v3/WithdrawController.php index 92d1abf..4938cca 100644 --- a/app/Controller/v3/WithdrawController.php +++ b/app/Controller/v3/WithdrawController.php @@ -8,7 +8,7 @@ use App\Constants\v3\LogLabel; use App\Constants\v3\UserType; use App\Controller\BaseController; use App\Exception\ErrorCodeException; -use App\Model\SystemConfig; +use App\Model\v3\SystemConfig; use App\Model\v3\FinancialRecord; use App\Model\v3\Store; use App\Model\v3\StoreWithdrawal;