From 4454a97fbc43ea0884229a33b1979ba564820a7d Mon Sep 17 00:00:00 2001 From: devil_gong Date: Mon, 17 Jun 2019 15:32:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/payment/Weixin.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/extend/payment/Weixin.php b/extend/payment/Weixin.php index 89b2d46f5..2cd2d8a56 100755 --- a/extend/payment/Weixin.php +++ b/extend/payment/Weixin.php @@ -245,7 +245,7 @@ class Weixin $pay_data['paySign'] = $this->GetSign($pay_data); // 微信中 - if(!empty($_SERVER['HTTP_USER_AGENT']) && stripos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) + if(in_array(APPLICATION_CLIENT_TYPE, ['pc', 'h5']) && !empty($_SERVER['HTTP_USER_AGENT']) && stripos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) { $this->PayHtml($pay_data, $redirect_url); } else { @@ -396,9 +396,12 @@ class Weixin } // 微信中打开 - if(!empty($_SERVER['HTTP_USER_AGENT']) && stripos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) + if(in_array(APPLICATION_CLIENT_TYPE, ['pc', 'h5'])) { - $type_all['pc'] = $type_all['weixin']; + if(!empty($_SERVER['HTTP_USER_AGENT']) && stripos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) + { + $type_all['pc'] = $type_all['weixin']; + } } return isset($type_all[APPLICATION_CLIENT_TYPE]) ? $type_all[APPLICATION_CLIENT_TYPE] : '';