|
|
@@ -387,30 +387,27 @@ class DispatchService
|
|
|
private function prepareShunfengData($order, $shop)
|
|
|
{
|
|
|
// 获取订单商品信息
|
|
|
- $itemInfos = OrderItemClass::getAllByCondition(['orderSn' => $order['orderSn']], null, 'id, name, unitPrice, num, unitWeight');
|
|
|
-
|
|
|
+ // $itemInfos = OrderItemClass::getAllByCondition(['orderSn' => $order['orderSn']], null, 'id, name, unitPrice, num, unitWeight');
|
|
|
// 计算商品总重量(单位:克)
|
|
|
- $totalWeight = 0;
|
|
|
- foreach ($itemInfos as $item) {
|
|
|
- $totalWeight += (int)($item['unitWeight'] * $item['num']) * 1000;
|
|
|
- }
|
|
|
-
|
|
|
+ // $totalWeight = 0;
|
|
|
+ // foreach ($itemInfos as $item) {
|
|
|
+ // $totalWeight += (int)($item['unitWeight'] * $item['num']) * 1000;
|
|
|
+ // }
|
|
|
// 如果没有商品重量,使用订单重量
|
|
|
- if ($totalWeight == 0 && isset($order['weight'])) {
|
|
|
- $totalWeight = (int)$order['weight'] * 1000;
|
|
|
- }
|
|
|
-
|
|
|
+ // if ($totalWeight == 0 && isset($order['weight'])) {
|
|
|
+ // $totalWeight = (int)$order['weight'] * 1000;
|
|
|
+ // }
|
|
|
// 默认重量为1000克(1公斤)
|
|
|
- if ($totalWeight == 0) {
|
|
|
- $totalWeight = 1000;
|
|
|
- }
|
|
|
+ // if ($totalWeight == 0) {
|
|
|
+ // $totalWeight = 1000;
|
|
|
+ // }
|
|
|
|
|
|
return [
|
|
|
'platform' => 'shunfeng',
|
|
|
'user_lng' => (string)$order['long'], // 用户地址经度
|
|
|
'user_lat' => (string)$order['lat'], // 用户地址纬度
|
|
|
'user_address' => $order['fullAddress'], // 用户详细地址
|
|
|
- 'weight' => $totalWeight, // 物品重量(单位:克)
|
|
|
+ 'weight' => $order['weight'], // 物品重量(单位:克)
|
|
|
'product_type' => 4, // 物品类型(4:鲜花绿植)
|
|
|
'push_time' => time(), // 推单时间(秒级时间戳)
|
|
|
'shop' => [ // 发货店铺信息
|