diff --git a/crmeb/app/api/controller/v1/order/OtherOrderController.php b/crmeb/app/api/controller/v1/order/OtherOrderController.php index 6be74663f..92b65bc94 100644 --- a/crmeb/app/api/controller/v1/order/OtherOrderController.php +++ b/crmeb/app/api/controller/v1/order/OtherOrderController.php @@ -157,8 +157,8 @@ class OtherOrderController */ public function pay_type(Request $request) { - $payType['ali_pay_status'] = is_ali_pay(); - $payType['pay_weixin_open'] = is_wecaht_pay(); + $payType['ali_pay_status'] = sys_config('ali_pay_status', 0) != 0; + $payType['pay_weixin_open'] = sys_config('pay_weixin_open', 0) != 0; $payType['site_name'] = sys_config('site_name'); $payType['now_money'] = $request->user('now_money'); $payType['offline_pay_status'] = true; diff --git a/crmeb/app/common.php b/crmeb/app/common.php index 07ace6046..72c84a734 100644 --- a/crmeb/app/common.php +++ b/crmeb/app/common.php @@ -23,55 +23,6 @@ use app\services\system\lang\LangCodeServices; use app\services\system\lang\LangCountryServices; use think\facade\Config; - -if (!function_exists('is_wechat_pay')) { - /** - * @return bool - * @author 等风来 - * @email 136327134@qq.com - * @date 2023/2/8 - */ - function is_wecaht_pay() - { - $wechat_pay_type = (int)sys_config('wechat_pay_type', 0); - $wechatPay = (int)sys_config('pay_weixin_open') == 1; - $allinPay = (int)sys_config('allin_pay_status') == 1; - - if ($wechat_pay_type == 0 && $wechatPay) { - return true; - } elseif ($wechat_pay_type == 1 && $allinPay) { - if ((request()->isRoutine() || request()->isWechat())) { - return true; - } - } - return false; - } -} - -if (!function_exists('is_ali_pay')) { - /** - * @return bool - * @author 等风来 - * @email 136327134@qq.com - * @date 2023/2/8 - */ - function is_ali_pay() - { - $alipay_pay_type = (int)sys_config('alipay_pay_type', 0); - $aliPay = (int)sys_config('ali_pay_status') == 1; - $allinPay = (int)sys_config('allin_pay_status') == 1; - - if ($alipay_pay_type == 0 && $aliPay) { - return true; - } elseif ($alipay_pay_type == 1 && $allinPay) { - if (request()->isApp()) { - return true; - } - } - return false; - } -} - if (!function_exists('getWorkerManUrl')) { /** diff --git a/crmeb/app/services/order/StoreOrderServices.php b/crmeb/app/services/order/StoreOrderServices.php index 3ebf5198b..5d861817a 100644 --- a/crmeb/app/services/order/StoreOrderServices.php +++ b/crmeb/app/services/order/StoreOrderServices.php @@ -172,8 +172,8 @@ class StoreOrderServices extends BaseServices $data['refund_count'] = bcadd(bcadd($data['refunding_count'], $data['refunded_count'], 0), $data['no_refund_count'], 0); $data['yue_pay_status'] = (int)sys_config('balance_func_status') && (int)sys_config('yue_pay_status') == 1 ? (int)1 : (int)2;//余额支付 1 开启 2 关闭 $data['pc_order_count'] = $data['order_count'] + $data['refunding_count'] + $data['refunded_count']; - $data['pay_weixin_open'] = is_wecaht_pay();//微信支付 1 开启 0 关闭 - $data['ali_pay_status'] = is_ali_pay();//支付包支付 1 开启 0 关闭 + $data['pay_weixin_open'] = sys_config('pay_weixin_open', '0') != '0';//微信支付 1 开启 0 关闭 + $data['ali_pay_status'] = sys_config('ali_pay_status', '0') != '0';//支付包支付 1 开启 0 关闭 $data['friend_pay_status'] = (int)sys_config('friend_pay_status') ?? 0;//好友代付 1 开启 0 关闭 return $data; } @@ -1584,7 +1584,7 @@ HTML; $data['integralRatio'] = $other['integralRatio']; $data['offline_pay_status'] = (int)sys_config('offline_pay_status') ?? (int)2; $data['yue_pay_status'] = (int)sys_config('balance_func_status') && (int)sys_config('yue_pay_status') == 1 ? (int)1 : (int)2;//余额支付 1 开启 2 关闭 - $data['pay_weixin_open'] = is_wecaht_pay();//微信支付 1 开启 0 关闭 + $data['pay_weixin_open'] = sys_config('pay_weixin_open', '0') != '0';//微信支付 1 开启 0 关闭 $data['friend_pay_status'] = (int)sys_config('friend_pay_status') ?? 0;//好友代付 1 开启 0 关闭 $data['store_self_mention'] = (int)sys_config('store_self_mention') ?? 0;//门店自提是否开启 /** @var SystemStoreServices $systemStoreServices */ @@ -1592,7 +1592,7 @@ HTML; $store_count = $systemStoreServices->count(['type' => 0]); $data['store_self_mention'] = $data['store_self_mention'] && $store_count; - $data['ali_pay_status'] = is_ali_pay();//支付包支付 1 开启 0 关闭 + $data['ali_pay_status'] = sys_config('ali_pay_status', '0') != '0';//支付包支付 1 开启 0 关闭 $data['system_store'] = [];//门店信息 /** @var UserInvoiceServices $userInvoice */ $userInvoice = app()->make(UserInvoiceServices::class); @@ -1696,7 +1696,7 @@ HTML; $res = false; switch ($payType) { case PayServices::WEIXIN_PAY: - $res = (bool)sys_config('pay_weixin_open'); + $res = sys_config('pay_weixin_open', '0') != '0'; break; case PayServices::YUE_PAY: $res = sys_config('balance_func_status') && sys_config('yue_pay_status') == 1; @@ -1705,7 +1705,7 @@ HTML; $res = sys_config('offline_pay_status') == 1; break; case PayServices::ALIAPY_PAY: - $res = sys_config('ali_pay_status') == 1; + $res = sys_config('ali_pay_status', '0') != '0'; break; case PayServices::FRIEND: $res = sys_config('friend_pay_status', 1) == 1; @@ -2354,8 +2354,8 @@ HTML; } $order['mapKey'] = sys_config('tengxun_map_key'); $order['yue_pay_status'] = (int)sys_config('balance_func_status') && (int)sys_config('yue_pay_status') == 1 ? (int)1 : (int)2;//余额支付 1 开启 2 关闭 - $order['pay_weixin_open'] = (int)sys_config('pay_weixin_open') ?? 0;//微信支付 1 开启 0 关闭 - $order['ali_pay_status'] = (bool)sys_config('ali_pay_status');//支付包支付 1 开启 0 关闭 + $order['pay_weixin_open'] = sys_config('pay_weixin_open') != '0';//微信支付 1 开启 0 关闭 + $order['ali_pay_status'] = sys_config('ali_pay_status', '0') != '0';//支付包支付 1 开启 0 关闭 $order['friend_pay_status'] = (int)sys_config('friend_pay_status') ?? 0;//好友代付 1 开启 0 关闭 $orderData = $this->tidyOrder($order, true, true); $vipTruePrice = $memberPrice = $levelPrice = 0; @@ -2495,8 +2495,8 @@ HTML; { //支付类型开关 $data = [ - 'ali_pay_status' => is_ali_pay(), - 'wechat_pay_status' => is_wecaht_pay(), + 'ali_pay_status' => sys_config('ali_pay_status', '0') != '0', + 'wechat_pay_status' => sys_config('pay_weixin_open', '0') != '0', 'offline_pay_status' => (int)sys_config('offline_pay_status') == 1, 'friend_pay_status' => (int)sys_config('friend_pay_status') == 1, 'yue_pay_status' => (int)sys_config('balance_func_status') && (int)sys_config('yue_pay_status') == 1, diff --git a/crmeb/app/services/pay/OrderPayServices.php b/crmeb/app/services/pay/OrderPayServices.php index 86683cba4..458ee43de 100644 --- a/crmeb/app/services/pay/OrderPayServices.php +++ b/crmeb/app/services/pay/OrderPayServices.php @@ -50,22 +50,14 @@ class OrderPayServices */ public function getPayType(string $payType) { - $allinPay = (int)sys_config('allin_pay_status') == 1; - //微信支付没有开启,通联支付开启,用户访问端在小程序或者公众号的时候,使用通联微信H5支付 if ($payType == PayServices::WEIXIN_PAY) { - $wechat_pay_type = (int)sys_config('wechat_pay_type', 0); - if ($wechat_pay_type == 1 && $allinPay && (request()->isRoutine() || request()->isWechat())) { - $payType = PayServices::ALLIN_PAY; - } + $payType = sys_config('pay_weixin_open', 0); } //支付宝没有开启,通联支付开了,用户使用支付宝支付,并且在app端访问的时候,使用通联app支付宝支付 if ($payType == PayServices::ALIAPY_PAY) { - $alipay_pay_type = (int)sys_config('alipay_pay_type', 0); - if ($alipay_pay_type == 1 && $allinPay && request()->isApp()) { - $payType = PayServices::ALLIN_PAY; - } + $payType = sys_config('ali_pay_status', 0); } return $payType; diff --git a/crmeb/app/services/system/config/SystemConfigServices.php b/crmeb/app/services/system/config/SystemConfigServices.php index 2ec3d78fc..dc0802b4d 100644 --- a/crmeb/app/services/system/config/SystemConfigServices.php +++ b/crmeb/app/services/system/config/SystemConfigServices.php @@ -402,10 +402,12 @@ class SystemConfigServices extends BaseServices foreach ($parameter as $v) { if (strstr($v, $this->cuttingStr) !== false) { $pdata = explode($this->cuttingStr, $v); - $options[] = ['label' => $pdata[1], 'value' => $pdata[0]]; + $res = preg_match('/^[0-9]$/', $pdata[0]); + $options[] = ['label' => $pdata[1], 'value' => $res ? (int)$pdata[0] : $pdata[0]]; } } - $formbuider[] = $radio = $this->builder->radio($data['menu_name'], $data['info'], (int)$data['value'])->options($options)->appendRule('suffix', [ + $res = preg_match('/^[0-9]$/', $data['value']); + $formbuider[] = $radio = $this->builder->radio($data['menu_name'], $data['info'], $res ? (int)$data['value'] : $data['value'])->options($options)->appendRule('suffix', [ 'type' => 'div', 'class' => 'tips-info', 'domProps' => ['innerHTML' => $data['desc']] diff --git a/crmeb/public/install/crmeb.sql b/crmeb/public/install/crmeb.sql index b66398b14..b18695644 100755 --- a/crmeb/public/install/crmeb.sql +++ b/crmeb/public/install/crmeb.sql @@ -33321,7 +33321,7 @@ INSERT INTO `eb_system_config` (`id`, `menu_name`, `type`, `input_type`, `config (26, 'pay_weixin_client_cert', 'upload', 'input', 4, '', 3, '', 0, 0, '\"\"', '微信支付证书', '微信支付证书,在微信商家平台中可以下载!文件名一般为apiclient_cert.pem', 0, 1), (27, 'pay_weixin_client_key', 'upload', 'input', 4, '', 3, '', 0, 0, '\"\"', '微信支付证书密钥', '微信支付证书密钥,在微信商家平台中可以下载!文件名一般为apiclient_key.pem', 0, 1), (28, 'pay_weixin_key', 'text', 'input', 4, '', 0, '', 100, 0, '\"\"', 'Key', '商户支付密钥Key。审核通过后,在微信发送的邮件中查看。', 0, 1), -(29, 'pay_weixin_open', 'radio', 'input', 109, '1=>开启\n0=>关闭', 1, '', 0, 0, '\"1\"', '微信支付', '是否启用微信支付', 100, 1), +(29, 'pay_weixin_open', 'radio', 'input', 109, '0=>关闭\nweixin=>微信\nallinpay=>通联', 1, '', 0, 0, '\"0\"', '微信支付', '请选择微信支付通道,关闭用户端不展示', 100, 1), (32, 'store_free_postage', 'text', 'number', 27, '', 0, 'number:true,min:-1', 100, 0, '1000000', '满额包邮', '商城商品满多少金额即可包邮,此项优先于其他的运费设置', 100, 1), (33, 'offline_postage', 'radio', 'input', 27, '1=>包邮\n0=>不包邮', 1, '', 0, 0, '0', '线下支付是否包邮', '用户选择线下支付时是否包邮', 97, 1), (34, 'integral_ratio', 'text', 'input', 11, '', 0, 'number:true', 100, 0, '\"0.1\"', '积分抵用', '积分抵用比例(1积分抵多少金额)单位:元', 10, 1), @@ -33393,7 +33393,7 @@ INSERT INTO `eb_system_config` (`id`, `menu_name`, `type`, `input_type`, `config (236, 'verify_expire_time', 'text', 'input', 20, '', 0, '', 100, 0, '\"5\"', '短信验证码过期时间(分钟)', '短信验证码过期时间(分钟)', 0, 1), (246, 'invoice_func_status', 'radio', '', 50, '1=>开启\n0=>关闭', 0, '', 0, 0, '1', '发票功能启用', '发票功能开启|关闭', 0, 1), (247, 'special_invoice_status', 'radio', '', 50, '1=>开启\n0=>关闭', 0, '', 0, 0, '1', '专用发票启用', '专用发票功能开启|关闭', 0, 1), -(287, 'ali_pay_status', 'radio', 'input', 109, '1=>开启\n0=>关闭', 1, '', 0, 0, '\"1\"', '支付宝支付', '支付宝支付请选择开启(启用)或关闭(不启用)', 98, 1), +(287, 'ali_pay_status', 'radio', 'input', 109, '0=>关闭\nalipay=>支付宝\nallinpay=>通联', 1, '', 0, 0, '\"0\"', '支付宝支付', '请选择支付宝通道,关闭用户端不显示', 98, 1), (288, 'alipay_public_key', 'textarea', '', 63, '', 1, '', 100, 5, '\"\"', '支付应用公钥', '支付宝加签完成后申城的支付宝公钥', 0, 1), (289, 'alipay_merchant_private_key', 'textarea', '', 63, '', 0, '', 100, 5, '\"\"', '支付应用私钥', '支付应用私钥', 0, 1), (290, 'ali_pay_appid', 'text', 'input', 63, '', 0, '', 100, 0, '\"\"', '支付应用Appid', '支付应用Appid', 91, 1), @@ -33494,6 +33494,9 @@ INSERT INTO `eb_system_config` (`id`, `menu_name`, `type`, `input_type`, `config (420, 'fey_user', 'text', 'input', 107, '', 1, '', 0, 0, '\"\"', '飞鹅云USER', '飞鹅云后台注册账号', 10, 1), (421, 'fey_ukey', 'text', 'input', 107, '', 1, '', 0, 0, '\"\"', '飞鹅云UYEK', '飞鹅云后台注册账号后生成的UKEY 【备注:这不是填打印机的KEY】', 7, 1), (422, 'fey_sn', 'text', 'input', 107, '', 1, '', 100, 0, '\"\"', '飞鹅云SN', '打印机标签上的编号,必须要在管理后台里添加打印机或调用API接口添加之后,才能调用API', 0, 1), +(423, 'allin_private_key', 'text', 'input', 108, '', 1, '', 100, 5, '\"56585c3f475ecaf0fb4993a8500ee392\"', '通联MD5私钥', '通联支付的MD5私钥,可以在商户后台设置中进行配置', 96, 1), +(425, 'allin_cusid', 'text', '', 108, '', 1, '', 0, 0, '\"660791057340QWW\"', '通联商户号', '通联支付商户号,由贵公司申请获得', 99, 1), +(426, 'allin_appid', 'text', '', 108, '', 1, '', 100, 0, '\"00259494\"', '通联支付Appid', '通联商户后台的设置-》对接设置中查看', 98, 1), (428, 'queue_open', 'radio', 'input', 26, '0=>关闭\n1=>开启', 1, '', 0, 0, '\"0\"', '消息队列', '是否启用消息队列,启用后提升程序运行速度,启用前必须配置Redis缓存', 0, 1), (429, 'get_avatar', 'radio', 'input', 7, '0=>关闭\n1=>开启', 1, '', 0, 0, '\"0\"', '强制获取昵称头像', '是否在小程序用户授权之后,弹窗获取用户的昵称和头像', 0, 1); @@ -33576,6 +33579,7 @@ INSERT INTO `eb_system_config_tab` (`id`, `pid`, `title`, `eng_title`, `status`, (105, 100, '新用户设置', 'new_user_setting', 1, 0, '', 0, 0), (106, 5, '机器翻译配置', 'online_translation', 1, 0, '', 0, 0), (107, 21, '飞鹅云配置', 'fey_config', 1, 0, '', 3, 0), +(108, 23, '通联支付', 'allinpay', 1, 0, '', 3, 0), (109, 23, '基础配置', 'pay_basic', 1, 0, '', 3, 100); -- -------------------------------------------------------- diff --git a/template/admin/src/pages/marketing/storeIntegralOrder/components/tableList.vue b/template/admin/src/pages/marketing/storeIntegralOrder/components/tableList.vue index 2c20c35eb..5a99a1315 100644 --- a/template/admin/src/pages/marketing/storeIntegralOrder/components/tableList.vue +++ b/template/admin/src/pages/marketing/storeIntegralOrder/components/tableList.vue @@ -36,7 +36,7 @@ 配送信息