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]),