diff --git a/config/autoload/logger.php b/config/autoload/logger.php index fd91146..2d6f22a 100644 --- a/config/autoload/logger.php +++ b/config/autoload/logger.php @@ -24,9 +24,20 @@ if ($appEnv == 'dev') { ], ]; }else{ +// $formatter = [ +// 'class' => Monolog\Formatter\JsonFormatter::class, +// 'constructor' => [], +// ]; + + // 暂时修改为正式 $formatter = [ - 'class' => Monolog\Formatter\JsonFormatter::class, - 'constructor' => [], + 'class' => Monolog\Formatter\LineFormatter::class, + 'constructor' => [ + 'format' => null, + 'dateFormat' => 'Y-m-d H:i:s', + 'allowInlineLineBreaks' => true, + 'includeStacktraces' => true, + ], ]; } return [ diff --git a/extend/Wechat/WechatPay.php b/extend/Wechat/WechatPay.php index 40da8e0..f2a5ab3 100644 --- a/extend/Wechat/WechatPay.php +++ b/extend/Wechat/WechatPay.php @@ -23,6 +23,7 @@ class WechatPay protected array $pay_config;// 支付系统配置 protected string $pay_notify_url;// 支付回调地址 protected string $refund_notify_url;// 退款回调地址 + protected string $domain_name;// 退款网址 /** * @param string $user_type 用户类型(1:患者端 2:专家端 3:药师端) @@ -57,6 +58,13 @@ class WechatPay $this->pay_notify_url = $this->config['product_pay_notify_url']; $this->refund_notify_url = $this->config['product_refund_notify_url']; } + + $app_env = config('app_env','dev'); + if ($app_env == "prod"){ + $this->domain_name = env('DOMAIN_NAME_DEV','https://dev.hospital.applets.igandanyiyuan.com/'); + }else{ + $this->domain_name = env('DOMAIN_NAME_PROD','https://prod.hospital.applets.igandanyiyuan.com/'); + } } /** @@ -126,7 +134,7 @@ class WechatPay "out_trade_no" => $out_trade_no, // 商户系统内部订单号 "appid" => $this->config['app_id'], "description" => "问诊服务", - "notify_url" => env('DOMAIN_NAME_DEV') . $this->pay_notify_url, + "notify_url" => $this->domain_name . $this->pay_notify_url, "amount" => [ "total" => $total,//订单总金额,单位为分。 "currency" => "CNY" @@ -195,7 +203,7 @@ class WechatPay try { $app = $this->createApp(); - $options['notify_url'] = env('DOMAIN_NAME_DEV') . $this->refund_notify_url; + $options['notify_url'] = $this->domain_name . $this->refund_notify_url; $response = $app->getClient()->postJson("v3/refund/domestic/refunds", $options); if ($response->isFailed()) {