commit
c6092a4fc2
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Events\CreateLogisticEvent;
|
||||
use App\Events\StockUpdateEvent;
|
||||
use App\Exports\DiffTodayPriceGoodsExport;
|
||||
use App\Models\BusinessGoodsSku;
|
||||
|
||||
@ -265,11 +265,22 @@ class KuaiTuanTuan extends BusinessClient
|
||||
|
||||
public function createLogistic($orderSn, $waybillNo)
|
||||
{
|
||||
return Order::createOrderLogistic($orderSn, $waybillNo);
|
||||
[$type, $appendParams] = Order::createOrderLogistic($orderSn, $waybillNo);
|
||||
|
||||
return $this->doRequest($type, $appendParams);
|
||||
}
|
||||
|
||||
public function cancelLogistic($orderSn, $waybillNo)
|
||||
{
|
||||
return Order::deleteOrderLogistic($orderSn, $waybillNo);
|
||||
[$type, $appendParams] = Order::deleteOrderLogistic($orderSn, $waybillNo);
|
||||
|
||||
return $this->doRequest($type, $appendParams);
|
||||
}
|
||||
|
||||
public function getLogisticsCompanies()
|
||||
{
|
||||
[$type, $appendParams] = Order::getLogisticsCompanies();
|
||||
|
||||
return $this->doRequest($type, $appendParams);
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ class Order
|
||||
return [$type, $appendParams];
|
||||
}
|
||||
|
||||
public function getLogisticsCompanies()
|
||||
public static function getLogisticsCompanies()
|
||||
{
|
||||
$type = 'pdd.logistics.companies.get';
|
||||
|
||||
@ -66,7 +66,7 @@ class Order
|
||||
}
|
||||
|
||||
|
||||
public static function createOrderLogistic($orderSn, $waybillNo, $logisticsId = '', $logisticsName = '')
|
||||
public static function createOrderLogistic($orderSn, $waybillNo, $logisticsId = 44, $logisticsName = '顺丰快递')
|
||||
{
|
||||
// 不支持拆单发货
|
||||
$type = 'pdd.ktt.order.logistic.create';
|
||||
|
||||
@ -65,7 +65,7 @@ class WayBillService
|
||||
'participate_no' => $waybill->participate_no,
|
||||
'note' => $waybill->note,
|
||||
];
|
||||
event(new CreateLogisticEvent($shopId, $waybill->order_sn, $data['waybill_code']));
|
||||
event(new CreateLogisticEvent($shopShip->shop_id, $waybill->order_sn, $data['waybill_code']));
|
||||
}
|
||||
} else {
|
||||
$contents[$waybill->id] = [
|
||||
@ -116,13 +116,13 @@ class WayBillService
|
||||
return [$documents, $orderIds];
|
||||
}
|
||||
|
||||
private function saveWayBill($order, $shop, $senderConfig)
|
||||
private function saveWayBill($order, $shopShip, $senderConfig)
|
||||
{
|
||||
$waybill = Waybill::query()->firstOrNew(
|
||||
['order_sn' => $order['order_sn']]
|
||||
);
|
||||
|
||||
$waybill->shop_id = $shop->shop_id;
|
||||
$waybill->shop_id = $shopShip->shop_id;
|
||||
$waybill->object_id = $this->objectId;
|
||||
|
||||
$waybill->sender_country = $senderConfig['country'];
|
||||
@ -140,7 +140,7 @@ class WayBillService
|
||||
$waybill->recipient_name = $order['recipient_name'];
|
||||
$waybill->recipient_mobile = $order['recipient_mobile'];
|
||||
|
||||
$waybill->user_id = $shop->owner_id;
|
||||
$waybill->user_id = $shopShip->owner_id;
|
||||
$waybill->wp_code = $senderConfig['wp_code'];
|
||||
$waybill->order_sn = $order['order_sn'];
|
||||
$waybill->order_id = $order['id'];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user