From 467864b4f4dca61549eb25a45118a2e3d1e2467e Mon Sep 17 00:00:00 2001 From: zcy Date: Tue, 26 Apr 2022 18:40:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E4=B8=AA=E8=AF=AD=E8=A8=80=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/ServicePay/GuMaPayServices.php | 20 +++++++++++++++----- app/ServicePay/PayApiInterface.php | 2 +- app/ServicePay/PayTrait.php | 1 + resources/views/web/order/code.blade.php | 3 ++- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/app/ServicePay/GuMaPayServices.php b/app/ServicePay/GuMaPayServices.php index f9ad5a2..cce9e51 100644 --- a/app/ServicePay/GuMaPayServices.php +++ b/app/ServicePay/GuMaPayServices.php @@ -78,7 +78,7 @@ class GuMaPayServices implements PayApiInterface } - public function pay($pay_data) + public function pay($pay_data,$order) { //订单开始时间,倒计时 @@ -98,12 +98,22 @@ class GuMaPayServices implements PayApiInterface 'pay_status' => $this->order->pay_status == 1 ? '已支付' : '等待支付', 'only_time' =>$time_only ]; + $lange = $order->language ?? 'zh_cn'; + $appPath = base_path(); + $dir = $appPath . DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'web' . DIRECTORY_SEPARATOR . 'order' . DIRECTORY_SEPARATOR; + $file = $lange == 'zh_cn' ? '' : $lange; + if ($file != '') { + $filedir = $dir . $lange . DIRECTORY_SEPARATOR . 'code.blade.php'; + } else { + $filedir = $dir . 'code.blade.php'; + } - - return view('web.order.code', $data); - - + if (file_exists($filedir)) { + return view('web.order.' . $lange . '.code', $data); + } else { + return view('web.order.code', $data); + } } /* diff --git a/app/ServicePay/PayApiInterface.php b/app/ServicePay/PayApiInterface.php index adb73c0..2540dc3 100644 --- a/app/ServicePay/PayApiInterface.php +++ b/app/ServicePay/PayApiInterface.php @@ -18,7 +18,7 @@ interface PayApiInterface public function payConfig($type, $setConfig = []); //统一下单支付 - public function pay($pay_data); + public function pay($pay_data,$order); //统一验证签名 public function verify(); diff --git a/app/ServicePay/PayTrait.php b/app/ServicePay/PayTrait.php index ea98f63..e802931 100644 --- a/app/ServicePay/PayTrait.php +++ b/app/ServicePay/PayTrait.php @@ -331,6 +331,7 @@ trait PayTrait $data['out_user_id'] = $request->input('user_id', ''); $data['out_trade_sn'] = $request->input('out_trade_sn', ''); $data['ewm_account'] = $request->input('ewm_account', ''); + $data['language'] = $request->input('language', 'zh_cn'); $data['order_at'] = date('Y-m-d H:i:s'); if ($is_local) { diff --git a/resources/views/web/order/code.blade.php b/resources/views/web/order/code.blade.php index 01cf30c..b245ab3 100644 --- a/resources/views/web/order/code.blade.php +++ b/resources/views/web/order/code.blade.php @@ -197,7 +197,8 @@ } .code h4{ color: red; - text-align: center; + text-align: right; + padding-right: 15px; }