|
@@ -45,7 +45,7 @@ class DeliveryController extends BaseController
|
|
|
util::success(['platformList'=>$platformList]);
|
|
util::success(['platformList'=>$platformList]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 花店发货 -- 获取多个平台报价
|
|
|
|
|
|
|
+ // 花店发货时 -- 获取多个平台报价
|
|
|
public function actionHdAllDeliveryQuotes()
|
|
public function actionHdAllDeliveryQuotes()
|
|
|
{
|
|
{
|
|
|
$post = Yii::$app->request->post();
|
|
$post = Yii::$app->request->post();
|
|
@@ -67,7 +67,6 @@ class DeliveryController extends BaseController
|
|
|
if(isset($platformQuotes['error'])){
|
|
if(isset($platformQuotes['error'])){
|
|
|
util::fail($platformQuotes['error']);
|
|
util::fail($platformQuotes['error']);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
// 格式化各平台报价为前端展示格式
|
|
// 格式化各平台报价为前端展示格式
|
|
|
$deliveryList = $ds->formatPlatformQuotesForDisplay($platformQuotes);
|
|
$deliveryList = $ds->formatPlatformQuotesForDisplay($platformQuotes);
|
|
|
// 按 price 从低到高排序
|
|
// 按 price 从低到高排序
|
|
@@ -77,7 +76,7 @@ class DeliveryController extends BaseController
|
|
|
util::success($ret, "success");
|
|
util::success($ret, "success");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 花店向批发买花 -- 获取多个平台报价
|
|
|
|
|
|
|
+ // 花店向批发买花时 -- 获取多个平台报价
|
|
|
public function actionAllDeliveryQuotes()
|
|
public function actionAllDeliveryQuotes()
|
|
|
{
|
|
{
|
|
|
$post = Yii::$app->request->post();
|
|
$post = Yii::$app->request->post();
|
|
@@ -92,11 +91,10 @@ class DeliveryController extends BaseController
|
|
|
|
|
|
|
|
// --------- $customId
|
|
// --------- $customId
|
|
|
$customId = $ghs->customId ?? 0;
|
|
$customId = $ghs->customId ?? 0;
|
|
|
- $custom = CustomClass::getById($customId, true);
|
|
|
|
|
|
|
+ $custom = CustomClass::getById($customId, true); // 批发的 custom
|
|
|
if (empty($custom)) {
|
|
if (empty($custom)) {
|
|
|
util::fail('获取custom数据失败');
|
|
util::fail('获取custom数据失败');
|
|
|
}
|
|
}
|
|
|
- $weight = $post['weight'] ?? 1;
|
|
|
|
|
|
|
|
|
|
// 生成随机订单号
|
|
// 生成随机订单号
|
|
|
$prefix = 'XSD_CS-' . $ghs->mainId . '-';
|
|
$prefix = 'XSD_CS-' . $ghs->mainId . '-';
|
|
@@ -114,10 +112,10 @@ class DeliveryController extends BaseController
|
|
|
'long' => $custom['long'],
|
|
'long' => $custom['long'],
|
|
|
'address' => $custom['address'], //'toAddress' => $order['address'],
|
|
'address' => $custom['address'], //'toAddress' => $order['address'],
|
|
|
'city' => $custom['city'],
|
|
'city' => $custom['city'],
|
|
|
- 'weight' => $weight,
|
|
|
|
|
|
|
+ 'weight' => $post['weight'] ?? 1,
|
|
|
'remark' => $post['remark'] ?? '',
|
|
'remark' => $post['remark'] ?? '',
|
|
|
- 'prePrice' => 10, // TODO 要从前端获取
|
|
|
|
|
- 'actPrice' => 10, // TODO
|
|
|
|
|
|
|
+ 'prePrice' => floatval($post['totalPrice'] ?? 0),
|
|
|
|
|
+ 'actPrice' => floatval($post['totalPrice'] ?? 0),
|
|
|
];
|
|
];
|
|
|
$ghsShop = ShopClass::getById($ghsShopId);
|
|
$ghsShop = ShopClass::getById($ghsShopId);
|
|
|
$ds = new DispatchService($ghs->mainId);
|
|
$ds = new DispatchService($ghs->mainId);
|