Skip to content

Commit

Permalink
Merge pull request #41 from liushuai/feat-k5
Browse files Browse the repository at this point in the history
修改 k5川日部分单子提交物流
  • Loading branch information
icowan authored Feb 4, 2021
2 parents d055968 + 2e948f3 commit 601fbae
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions src/platforms/K5Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,25 +296,15 @@ protected function formatOrder(Order $orderClass): array
{

$items = [];
$volumes = [];
foreach ($orderClass->goods as $good) {
$items[] = [
'Sku'=>$good->sku, // 产品 Sku (OrderType 为仓储订单必传)
'Sku'=>is_null($good->sku)?'':$good->sku, // 产品 Sku (OrderType 为仓储订单必传)
'Cnname'=>$good->cnDescription, // 产品中文名
'Enname'=>$good->description, // 产品英文名
'Price'=>$good->worth, // 单价
'SingleWeight'=>$good->weight, // 单件重量
'Num'=>$good->quantity, // 数量
];
$volumes[] = [
'Weight'=> $good->weight, // 实重
'Number'=>$good->quantity, // 件数
// 'Length'=>$good->length, // 长
// 'Width'=>$good->width, // 宽
// 'Height'=> $good->height, // 高

];

}

return [
Expand All @@ -328,19 +318,19 @@ protected function formatOrder(Order $orderClass): array
'TotalValue'=>$orderClass->package->declareWorth, // 订单总申报价值
'Number'=>$orderClass->package->quantity, // 件数
'Recipient'=>[
'Name'=>$orderClass->recipient->name, // 名称
'Company'=>$orderClass->recipient->company,
'Addres1'=>$orderClass->recipient->address, // 电话
'Addres2'=> $orderClass->recipient->doorplate, // 电话
'Name'=>is_null($orderClass->recipient->name)?'':$orderClass->recipient->name, // 名称
'Company'=>is_null($orderClass->recipient->company)?'':$orderClass->recipient->company,
'Addres1'=>is_null($orderClass->recipient->address)?'':$orderClass->recipient->address, // 地址1
'Addres2'=>is_null($orderClass->recipient->doorplate)?'':$orderClass->recipient->doorplate, // 地址2
'Tel'=> $orderClass->recipient->phone, // 电话
'Province'=>$orderClass->recipient->state, // 省州
'City'=>$orderClass->recipient->city, // 城市
'Post'=>$orderClass->recipient->zip, // 邮编
],
'Sender'=>[
'Name'=>$orderClass->shipper->name, // 名称
'Company'=>$orderClass->shipper->company,
'Addres'=>$orderClass->shipper->address, // 电话
'Company'=>is_null($orderClass->shipper->company)?'':$orderClass->shipper->company,
'Addres'=>is_null($orderClass->shipper->address)?'':$orderClass->shipper->address, // 地址
'Country'=> $orderClass->shipper->countryCode, // 国家
'Mobile'=> $orderClass->shipper->phone, // 电话
'Tel'=> $orderClass->shipper->phone, // 电话
Expand All @@ -351,8 +341,6 @@ protected function formatOrder(Order $orderClass): array

'OrderItems'=>$items, // 订单明细产品信息

'Volumes'=>$volumes, // 材积明细 (OrderType 为快递制单必传)

'FeePayData'=>[
'FeePayType'=>$this->FeePayType, // 支付方式[ PP:预付,CC:到付, TP:第三方]必传
],
Expand Down

0 comments on commit 601fbae

Please sign in to comment.