From f77a71ef0dc861db98500cf569409a2b96404cd9 Mon Sep 17 00:00:00 2001 From: Gosowong <1329847115@qq.com> Date: Mon, 15 May 2023 15:28:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=8E=A5=E5=8F=A3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../orderShipping/MiniOrderService.php | 24 ++++++++++--------- .../easywechat/orderShipping/OrderClient.php | 10 ++++---- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/crmeb/crmeb/services/easywechat/orderShipping/MiniOrderService.php b/crmeb/crmeb/services/easywechat/orderShipping/MiniOrderService.php index 6851c16c8..8f84608bc 100644 --- a/crmeb/crmeb/services/easywechat/orderShipping/MiniOrderService.php +++ b/crmeb/crmeb/services/easywechat/orderShipping/MiniOrderService.php @@ -4,6 +4,7 @@ namespace crmeb\services\easywechat\orderShipping; use crmeb\services\easywechat\Application; use crmeb\services\SystemConfigService; +use EasyWeChat\Core\Exceptions\HttpException; class MiniOrderService { @@ -24,8 +25,8 @@ class MiniOrderService { $payment = SystemConfigService::more(['routine_appId', 'routine_appsecret', 'pay_weixin_mchid', 'pay_new_weixin_open', 'pay_new_weixin_mchid']); return [ - 'order_shipping' => [ - 'appid' => $payment['routine_appId'] ?? '', + 'mini_program' => [ + 'app_id' => $payment['routine_appId'] ?? '', 'secret' => $payment['routine_appsecret'] ?? '', 'merchant_id' => empty($payment['pay_new_weixin_open']) ? trim($payment['pay_weixin_mchid']) : trim($payment['pay_new_weixin_mchid']), ] @@ -51,14 +52,15 @@ class MiniOrderService /** * 上传订单 - * @param string $out_trade_no - * @param int $logistics_type - * @param array $shipping_list - * @param string $payer_openid - * @param int $delivery_mode - * @param bool $is_all_delivered + * @param string $out_trade_no 订单号(商城订单好) + * @param int $logistics_type 物流模式,发货方式枚举值:1、实体物流配送采用快递公司进行实体物流配送形式 2、同城配送 3、虚拟商品,虚拟商品,例如话费充值,点卡等,无实体配送形式 4、用户自提 + * @param array $shipping_list 物流信息列表,发货物流单列表,支持统一发货(单个物流单)和分拆发货(多个物流单)两种模式,多重性: [1, 10] + * @param string $payer_openid 支付者,支付者信息 + * @param int $delivery_mode 发货模式,发货模式枚举值:1、UNIFIED_DELIVERY(统一发货)2、SPLIT_DELIVERY(分拆发货) 示例值: UNIFIED_DELIVERY + * @param bool $is_all_delivered 分拆发货模式时必填,用于标识分拆发货模式下是否已全部发货完成,只有全部发货完成的情况下才会向用户推送发货完成通知。示例值: true/false * @return array * + * @throws HttpException * @date 2023/05/09 * @author yyw */ @@ -76,7 +78,7 @@ class MiniOrderService * @param int $delivery_mode * @param bool $is_all_delivered * @return array - * @throws \EasyWeChat\Core\Exceptions\HttpException + * @throws HttpException * * @date 2023/05/10 * @author yyw @@ -103,7 +105,7 @@ class MiniOrderService /** * 判断是否开通 * @return bool - * @throws \EasyWeChat\Core\Exceptions\HttpException + * @throws HttpException * @throws \Psr\SimpleCache\InvalidArgumentException * * @date 2023/05/09 @@ -119,7 +121,7 @@ class MiniOrderService * 设置小修跳转路径 * @param $path * @return array - * @throws \EasyWeChat\Core\Exceptions\HttpException + * @throws HttpException * * @date 2023/05/10 * @author yyw diff --git a/crmeb/crmeb/services/easywechat/orderShipping/OrderClient.php b/crmeb/crmeb/services/easywechat/orderShipping/OrderClient.php index b75cbc50f..3ddd57114 100644 --- a/crmeb/crmeb/services/easywechat/orderShipping/OrderClient.php +++ b/crmeb/crmeb/services/easywechat/orderShipping/OrderClient.php @@ -14,11 +14,6 @@ class OrderClient extends BaseOrder const redis_prefix = 'mimi_order'; - public function __construct(AccessToken $accessToken, $config) - { - parent::__construct($accessToken, $config); - } - /** * @var \Redis */ @@ -264,12 +259,15 @@ class OrderClient extends BaseOrder if (!$this->getRedis()->exists($key)) { $date = $this->setDeliveryList(); if (!isset($date[$company_name])) { - throw new AdminException('物流公司异常'); + throw new AdminException('物流公司异常1'); } $express_company = $date[$company_name]; } else { $express_company = $this->getRedis()->hMGet($key, $company_name); } + if (empty($express_company)) { + throw new AdminException('物流公司异常2'); + } return $express_company; } From dc1cab3078f7ff890210e82e773ae6e718ec66b5 Mon Sep 17 00:00:00 2001 From: Gosowong <1329847115@qq.com> Date: Mon, 15 May 2023 15:37:39 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php | 2 +- .../crmeb/services/easywechat/orderShipping/OrderClient.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php b/crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php index ca1cba014..aa7389580 100644 --- a/crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php +++ b/crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php @@ -94,7 +94,7 @@ class BaseOrder extends AbstractAPI public function isManaged() { $params = [ - 'appid' => $this->config['config']['order_shipping']['appid'] + 'appid' => $this->config['config']['mini_program']['appid'] ]; return $this->resultHandle($this->parseJSON('POST', [self::BASE_API . self::ORDER . 'notify_confirm_receive', json_encode($params)])); } diff --git a/crmeb/crmeb/services/easywechat/orderShipping/OrderClient.php b/crmeb/crmeb/services/easywechat/orderShipping/OrderClient.php index 3ddd57114..fe383c80d 100644 --- a/crmeb/crmeb/services/easywechat/orderShipping/OrderClient.php +++ b/crmeb/crmeb/services/easywechat/orderShipping/OrderClient.php @@ -78,7 +78,7 @@ class OrderClient extends BaseOrder $params = [ 'order_key' => [ 'order_number_type' => 1, - 'mchid' => $this->config['config']['order_shipping']['merchant_id'], + 'mchid' => $this->config['config']['mini_program']['merchant_id'], 'out_trade_no' => $out_trade_no, ], 'logistics_type' => $logistics_type, @@ -127,7 +127,7 @@ class OrderClient extends BaseOrder $params = [ 'order_key' => [ 'order_number_type' => 1, - 'mchid' => $this->config['order_shipping']['merchant_id'], + 'mchid' => $this->config['mini_program']['merchant_id'], 'out_trade_no' => $out_trade_no, ], 'upload_time' => date(DATE_RFC3339), @@ -140,7 +140,7 @@ class OrderClient extends BaseOrder $sub_order = [ 'order_key' => [ 'order_number_type' => 1, - 'mchid' => $this->config['order_shipping']['merchant_id'], + 'mchid' => $this->config['mini_program']['merchant_id'], 'out_trade_no' => $order['out_trade_no'], 'logistics_type' => $logistics_type, ], From a553851da36bc362f2d835f86443cf9d41c6c52f Mon Sep 17 00:00:00 2001 From: Gosowong <1329847115@qq.com> Date: Mon, 15 May 2023 15:41:18 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php b/crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php index aa7389580..955a749b5 100644 --- a/crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php +++ b/crmeb/crmeb/services/easywechat/orderShipping/BaseOrder.php @@ -94,7 +94,7 @@ class BaseOrder extends AbstractAPI public function isManaged() { $params = [ - 'appid' => $this->config['config']['mini_program']['appid'] + 'appid' => $this->config['config']['mini_program']['app_id'] ]; return $this->resultHandle($this->parseJSON('POST', [self::BASE_API . self::ORDER . 'notify_confirm_receive', json_encode($params)])); }