mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-11-03 00:10:38 +00:00
Merge branch 'v5.0.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.0.0dev
This commit is contained in:
commit
9c1dde8622
@ -6,11 +6,18 @@
|
||||
|
||||
namespace app\adminapi\controller;
|
||||
|
||||
use crmeb\services\easywechat\orderShipping\MiniOrderService;
|
||||
|
||||
class Test
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
|
||||
$ship_list = [
|
||||
[
|
||||
'item_desc' => '蓝牙音乐手表 | Jeep智能表蓝牙'
|
||||
]
|
||||
];
|
||||
MiniOrderService::shippingByTradeNo('cp179280225803173888', 3, $ship_list, 'oZEAhsy60rrq96hE86LmBb9v_Kes');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ class BaseOrder extends AbstractAPI
|
||||
public function isManaged()
|
||||
{
|
||||
$params = [
|
||||
'appid' => $this->config['order_shipping']['appid']
|
||||
'appid' => $this->config['config']['order_shipping']['appid']
|
||||
];
|
||||
return $this->resultHandle($this->parseJSON('POST', [self::BASE_API . self::ORDER . 'notify_confirm_receive', json_encode($params)]));
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
namespace crmeb\services\easywechat\orderShipping;
|
||||
|
||||
use crmeb\services\easywechat\Application;
|
||||
use crmeb\services\SystemConfigService;
|
||||
|
||||
class MiniOrderService
|
||||
{
|
||||
@ -21,10 +22,12 @@ class MiniOrderService
|
||||
*/
|
||||
protected static function options(array $config = [])
|
||||
{
|
||||
$payment = SystemConfigService::more(['routine_appId', 'routine_appsecret', 'pay_weixin_mchid', 'pay_new_weixin_open', 'pay_new_weixin_mchid']);
|
||||
return [
|
||||
'order_shipping' => [
|
||||
'appid' => sys_config('routine_appId'),
|
||||
'merchant_id' => sys_config('pay_new_weixin_open') ? sys_config('pay_weixin_mchid') : sys_config('pay_new_weixin_mchid'),
|
||||
'appid' => $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']),
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ namespace crmeb\services\easywechat\orderShipping;
|
||||
|
||||
use crmeb\exceptions\AdminException;
|
||||
use crmeb\services\CacheService;
|
||||
use EasyWeChat\Core\AccessToken;
|
||||
use EasyWeChat\Core\Exceptions\HttpException;
|
||||
use think\facade\Cache;
|
||||
|
||||
@ -13,6 +14,11 @@ class OrderClient extends BaseOrder
|
||||
const redis_prefix = 'mimi_order';
|
||||
|
||||
|
||||
public function __construct(AccessToken $accessToken, $config)
|
||||
{
|
||||
parent::__construct($accessToken, $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* @var \Redis
|
||||
*/
|
||||
@ -77,7 +83,7 @@ class OrderClient extends BaseOrder
|
||||
$params = [
|
||||
'order_key' => [
|
||||
'order_number_type' => 1,
|
||||
'mchid' => $this->config['order_shipping']['merchant_id'],
|
||||
'mchid' => $this->config['config']['order_shipping']['merchant_id'],
|
||||
'out_trade_no' => $out_trade_no,
|
||||
],
|
||||
'logistics_type' => $logistics_type,
|
||||
|
||||
@ -29,6 +29,14 @@ class ServiceProvider implements ServiceProviderInterface
|
||||
*/
|
||||
public function register(Container $pimple)
|
||||
{
|
||||
$pimple['mini_program.access_token'] = function ($pimple) {
|
||||
return new AccessToken(
|
||||
$pimple['config']['order_shipping']['app_id'],
|
||||
$pimple['config']['order_shipping']['secret'],
|
||||
$pimple['cache']
|
||||
);
|
||||
};
|
||||
|
||||
$pimple['order_ship'] = function ($pimple) {
|
||||
return new OrderClient($pimple['access_token'], $pimple);
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user