调整支付,修复前台管理页面展示金额错误

This commit is contained in:
liaofei 2023-02-18 11:44:54 +08:00
parent be7b958dac
commit db085a8556
7 changed files with 22 additions and 76 deletions

View File

@ -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;

View File

@ -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')) {
/**

View File

@ -171,8 +171,8 @@ class StoreOrderServices extends BaseServices
$data['refunded_count'] = (string)$storeOrderRefundServices->count($refund_where + ['refund_type' => 6]);
$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['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;
}
@ -1583,7 +1583,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 */
@ -1591,7 +1591,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);
@ -1695,7 +1695,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;
@ -1704,7 +1704,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;
@ -2353,8 +2353,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;
@ -2494,8 +2494,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,

View File

@ -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;

View File

@ -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']]

View File

@ -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, '\"allinpay\"', '微信支付', '请选择微信支付通道,关闭用户端不展示', 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, '\"allinpay\"', '支付宝支付', '请选择支付宝通道,关闭用户端不显示', 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),

View File

@ -53,7 +53,8 @@
<view class="money">
<view class="x-money">{{$t(`¥`)}}{{ item.productInfo.price }}</view>
<view class="num">x{{ item.cart_num }}</view>
<view class="y-money">{{$t(`¥`)}}{{ item.productInfo.ot_price }}</view>
<view class="y-money" v-if='item.productInfo.attrInfo'>{{$t(`¥`)}}{{ item.productInfo.attrInfo.ot_price }}</view>
<view class="y-money" v-else>{{$t(`¥`)}}{{ item.productInfo.ot_price }}</view>
</view>
</navigator>
</view>