mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-29 14:01:07 +00:00
Merge branch 'v5.0.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.0.0dev
This commit is contained in:
commit
6668d26567
@ -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']['app_id']
|
||||
];
|
||||
return $this->resultHandle($this->parseJSON('POST', [self::BASE_API . self::ORDER . 'notify_confirm_receive', json_encode($params)]));
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
*/
|
||||
@ -83,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,
|
||||
@ -132,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),
|
||||
@ -145,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,
|
||||
],
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user