|
|
@@ -132,7 +132,10 @@ class Logistics
|
|
|
];
|
|
|
|
|
|
// 查询商品
|
|
|
- $orderGoods = OrderGoods::find()->where('ORDER_SN=:ORDER_SN', [':ORDER_SN' => $order['SN']])->select('ORDER_SN,REAL_PRICE,BUY_NUMS,SKU_CODE,GOODS_TITLE')->asArray()->all();
|
|
|
+ $orderGoods = OrderGoods::find()->where('ORDER_SN=:ORDER_SN', [':ORDER_SN' => $order['SN']])->select('ORDER_SN,REAL_PRICE,BUY_NUMS,SKU_CODE,GOODS_TITLE,CONTENT')->asArray()->all();
|
|
|
+ // 需要数量乘倍数的产品编号
|
|
|
+ $stackedProducts = Cache::getSystemConfig()['stackedProducts']['VALUE'];
|
|
|
+ $stackedProducts = explode(',', $stackedProducts);
|
|
|
|
|
|
$products = [];
|
|
|
foreach ($orderGoods as $item) {
|
|
|
@@ -140,18 +143,19 @@ class Logistics
|
|
|
'product_no' => $item['SKU_CODE'], // 客户系统中的产品编号
|
|
|
'product_name' => $item['GOODS_TITLE'], // 产品名称
|
|
|
'tracking_number' => Date::today('Ymd') . $this->_random(10, 1),
|
|
|
- 'quantity' => $item['BUY_NUMS'], // 产品数量
|
|
|
+ 'quantity' => in_array($item['SKU_CODE'], $stackedProducts) ? $item['BUY_NUMS'] * 2 : $item['BUY_NUMS'], // 产品数量
|
|
|
'total_price' => number_format(100, 2, '.', ''), // 订单总金额,Decimal 方便通关,固定100马币
|
|
|
'currency_code' => 'MYR', // 产品的货币代码. 如USD(美元),MYR(马来西亚林吉特),SGD(新加坡元),CNY(人民币)
|
|
|
'supplier' => 'MRT', // 品牌
|
|
|
- 'remark' => '300ML', // 备注:规格
|
|
|
+// 'remark' => '300ML', // 备注:规格
|
|
|
+ 'remark' => $item['CONTENT'], // 备注:规格
|
|
|
];
|
|
|
}
|
|
|
$request['products'] = $products;
|
|
|
|
|
|
LoggerTool::debug($request);
|
|
|
|
|
|
- return $this->curl(self::createOrderUrl, $request);
|
|
|
+// return $this->curl(self::createOrderUrl, $request);
|
|
|
}
|
|
|
|
|
|
// 3.获取产品/包裹的重量和状态.
|