From 74de5f0074aeee4f657b5f9d2958b542f40bf8a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=94=E5=A7=AC=E6=A1=91?= Date: Sun, 29 Aug 2021 01:27:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=81=E8=AE=B8OtherPay=E4=B8=AD=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E5=90=8C=E6=97=B6=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Admin/SystemController.php | 4 ++-- resources/views/admin/config/system.blade.php | 12 ++++++------ resources/views/user/components/purchase.blade.php | 8 +++++--- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/Admin/SystemController.php b/app/Http/Controllers/Admin/SystemController.php index 5cd6ea81..956d8949 100644 --- a/app/Http/Controllers/Admin/SystemController.php +++ b/app/Http/Controllers/Admin/SystemController.php @@ -103,12 +103,12 @@ class SystemController extends Controller $name = $request->input('name'); $value = $request->input('value'); - if (empty($value)) { // 关闭 或 空值 自动设NULL,减少系统设置存储 + if (empty($value) || $value === 'NaN') { // 关闭 或 空值 自动设NULL,减少系统设置存储 $value = null; } // 支付设置判断 - if ($value !== null && in_array($name, ['is_AliPay', 'is_QQPay', 'is_WeChatPay', 'is_otherPay'], true) && ! in_array($value, $this->getPayment(), true)) { + if ($value !== null && in_array($name, ['is_AliPay', 'is_QQPay', 'is_WeChatPay'], true) && ! in_array($value, $this->getPayment(), true)) { return Response::json(['status' => 'fail', 'message' => '请先完善该支付渠道的必要参数!']); } diff --git a/resources/views/admin/config/system.blade.php b/resources/views/admin/config/system.blade.php index c4c93be6..6e640d97 100644 --- a/resources/views/admin/config/system.blade.php +++ b/resources/views/admin/config/system.blade.php @@ -110,14 +110,14 @@ - + - + @@ -186,11 +186,11 @@ :list="['邮箱' => 'mail', 'ServerChan' => 'serverChan', 'Telegram' => 'telegram', '微信企业' => 'weChat', 'TG酱' => 'tgChat', 'PushPlus' => 'pushPlus']"/> + help="提醒N次后自动下线节点,为0/留空时不限制,不超过12"/> 'mail', 'Bark' => 'bark', 'ServerChan' => 'serverChan', 'Telegram' => 'telegram', '微信企业' => 'weChat', 'TG酱' => 'tgChat', 'PushPlus' => 'pushPlus']"/> - + @@ -422,7 +422,7 @@ $('#is_AliPay').selectpicker('val', '{{$is_AliPay}}'); $('#is_QQPay').selectpicker('val', '{{$is_QQPay}}'); $('#is_WeChatPay').selectpicker('val', '{{$is_WeChatPay}}'); - $('#is_otherPay').selectpicker('val', '{{$is_otherPay}}'); + $('#is_otherPay').selectpicker('val', {!! $is_otherPay !!}); $('#oauth_path').selectpicker('val', {!! $oauth_path !!}); $('#account_expire_notification').selectpicker('val', {!! $account_expire_notification !!}); $('#data_anomaly_notification').selectpicker('val', {!! $data_anomaly_notification !!}); diff --git a/resources/views/user/components/purchase.blade.php b/resources/views/user/components/purchase.blade.php index 6f72afc5..59439ad1 100644 --- a/resources/views/user/components/purchase.blade.php +++ b/resources/views/user/components/purchase.blade.php @@ -13,16 +13,18 @@ wechat @endif -@if(sysConfig('is_otherPay') == 'bitpayx') +@if(strpos(sysConfig('is_otherPay'), 'bitpayx') !== false) -@elseif(sysConfig('is_otherPay') == 'paypal') +@endif +@if(strpos(sysConfig('is_otherPay'), 'paypal') !== false) -@elseif(sysConfig('is_otherPay') == 'stripe') +@endif +@if(strpos(sysConfig('is_otherPay'), 'stripe') !== false)