|
@@ -481,15 +481,18 @@ class OrderService extends BaseService
|
|
|
$deliveryNo = request()->post('delivery_no', '');
|
|
$deliveryNo = request()->post('delivery_no', '');
|
|
|
$deliveryCode = request()->post('delivery_code', '');
|
|
$deliveryCode = request()->post('delivery_code', '');
|
|
|
|
|
|
|
|
- if (!$id) {
|
|
|
|
|
|
|
+ if (!$id || empty($deliveryCode)) {
|
|
|
return ['code' => 1, 'msg' => '参数错误'];
|
|
return ['code' => 1, 'msg' => '参数错误'];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 发货方式
|
|
// 发货方式
|
|
|
$deliveryType = \App\Services\ConfigService::make()->getConfigByCode('delivery_type',1);
|
|
$deliveryType = \App\Services\ConfigService::make()->getConfigByCode('delivery_type',1);
|
|
|
|
|
+
|
|
|
$order = $this->model->with(['user','orderGoods'])->find($id);
|
|
$order = $this->model->with(['user','orderGoods'])->find($id);
|
|
|
$orderGoods = isset($order['orderGoods'])?$order['orderGoods'] : [];
|
|
$orderGoods = isset($order['orderGoods'])?$order['orderGoods'] : [];
|
|
|
$goodsName = isset($orderGoods[0]['goods_name'])?$orderGoods[0]['goods_name']:'订单商品';
|
|
$goodsName = isset($orderGoods[0]['goods_name'])?$orderGoods[0]['goods_name']:'订单商品';
|
|
|
|
|
+ $goodsNum = isset($orderGoods[0]['num']) && $orderGoods[0]['num']?$orderGoods[0]['num']: 1;
|
|
|
|
|
+ $goodsUnit = isset($orderGoods[0]['unit']) && $orderGoods[0]['unit']?$orderGoods[0]['unit']: '个';
|
|
|
$userInfo = isset($order['user'])?$order['user'] : [];
|
|
$userInfo = isset($order['user'])?$order['user'] : [];
|
|
|
$openid = isset($userInfo['openid'])?$userInfo['openid'] : '';
|
|
$openid = isset($userInfo['openid'])?$userInfo['openid'] : '';
|
|
|
$mobile = isset($userInfo['mobile'])?$userInfo['mobile'] : '';
|
|
$mobile = isset($userInfo['mobile'])?$userInfo['mobile'] : '';
|
|
@@ -534,9 +537,10 @@ class OrderService extends BaseService
|
|
|
[
|
|
[
|
|
|
"tracking_no" => $deliveryNo,
|
|
"tracking_no" => $deliveryNo,
|
|
|
"express_company" => $deliveryCompany,
|
|
"express_company" => $deliveryCompany,
|
|
|
- "item_desc" => $goodsName,
|
|
|
|
|
|
|
+ "item_desc" => $goodsName."*".$goodsNum.$goodsUnit,
|
|
|
"contact" => [
|
|
"contact" => [
|
|
|
- "consignor_contact" => isset($order['receiver_mobile']) ? $order['receiver_mobile'] : $mobile
|
|
|
|
|
|
|
+ "receiver_contact" => isset($order['receiver_mobile']) && $order['receiver_mobile'] ? format_mobile($order['receiver_mobile']) : format_mobile($mobile)
|
|
|
|
|
+
|
|
|
]
|
|
]
|
|
|
]
|
|
]
|
|
|
],
|
|
],
|
|
@@ -546,6 +550,7 @@ class OrderService extends BaseService
|
|
|
]
|
|
]
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
|
|
+ var_dump($sendData);
|
|
|
$result = MpService::make()->requestApi('deliverySend',$sendData);
|
|
$result = MpService::make()->requestApi('deliverySend',$sendData);
|
|
|
$errcode = isset($result['errcode'])?$result['errcode'] : -1;
|
|
$errcode = isset($result['errcode'])?$result['errcode'] : -1;
|
|
|
$errmsg = isset($result['errmsg']) && $result['errmsg']?$result['errmsg'] : '请求失败';
|
|
$errmsg = isset($result['errmsg']) && $result['errmsg']?$result['errmsg'] : '请求失败';
|