|
|
@@ -575,35 +575,44 @@ class PurchaseController extends BaseController
|
|
|
//同城发货包装费和运费的计算
|
|
|
$sendCost = 0;
|
|
|
$sendDistance = 0;
|
|
|
+
|
|
|
+ $mapSet = ShopClass::hasIntraCity($this->shop);
|
|
|
+ $openIntraCity = $mapSet['openIntraCity'] ?? 0;
|
|
|
if ($sendType == dict::getDict('sendType', 'thirdSend')) {
|
|
|
- // 生成随机订单号
|
|
|
- $prefix = 'XSD_CS-' . $this->mainId . '-';
|
|
|
- $orderSn = $prefix . round(microtime(true) * 1000);
|
|
|
-
|
|
|
- // 使用 DeliveryQuoteUtil 获取配送报价
|
|
|
- try {
|
|
|
- $quoteResult = DeliveryQuoteUtil::getDeliveryQuote([
|
|
|
- 'productList' => $productList,
|
|
|
- 'deliveryPlatform' => $post['deliveryPlatform'],
|
|
|
- 'deliveryBracketContent' => $post['deliveryBracketContent'], // 平台多报价识别id
|
|
|
- 'ghsInfo' => $ghsInfo,
|
|
|
- 'custom' => $custom,
|
|
|
- 'order' => [
|
|
|
- 'orderSn' => $orderSn,
|
|
|
- 'goodsType' => 1, //商品类型:0花束 1花材
|
|
|
- 'itemTotalAmount' => $post['itemTotalAmount'] ?? 0,
|
|
|
- 'remark' => $post['remark'] ?? '',
|
|
|
- ],
|
|
|
- 'mainId' => $this->mainId,
|
|
|
- 'productCount' => $productCount,
|
|
|
- ]);
|
|
|
-
|
|
|
- $sendCost = $quoteResult['sendCost'];
|
|
|
- $sendDistance = $quoteResult['sendDistance'];
|
|
|
- } catch (\Exception $e) {
|
|
|
- util::fail($e->getMessage());
|
|
|
+ if ($openIntraCity == 2) {
|
|
|
+ util::fail('不能使用跑腿');
|
|
|
+ }
|
|
|
+ if ($openIntraCity == 1) {
|
|
|
+ // 生成随机订单号
|
|
|
+ $prefix = 'PT-XSD-' . $this->mainId . '-';
|
|
|
+ $orderSn = $prefix . round(microtime(true) * 1000);
|
|
|
+
|
|
|
+ // 使用 DeliveryQuoteUtil 获取配送报价
|
|
|
+ try {
|
|
|
+ $quoteResult = DeliveryQuoteUtil::getDeliveryQuote([
|
|
|
+ 'productList' => $productList,
|
|
|
+ 'deliveryPlatform' => $post['deliveryPlatform'],
|
|
|
+ 'deliveryBracketContent' => $post['deliveryBracketContent'], // 平台多报价识别id
|
|
|
+ 'ghsInfo' => $ghsInfo,
|
|
|
+ 'custom' => $custom,
|
|
|
+ 'order' => [
|
|
|
+ 'orderSn' => $orderSn,
|
|
|
+ 'goodsType' => 1, //商品类型:0花束 1花材
|
|
|
+ 'itemTotalAmount' => $post['itemTotalAmount'] ?? 0,
|
|
|
+ 'remark' => $post['remark'] ?? '',
|
|
|
+ ],
|
|
|
+ 'mainId' => $this->mainId,
|
|
|
+ 'productCount' => $productCount,
|
|
|
+ ]);
|
|
|
+
|
|
|
+ $sendCost = $quoteResult['sendCost'];
|
|
|
+ $sendDistance = $quoteResult['sendDistance'];
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ util::fail($e->getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
$post['sendCost'] = $sendCost;
|
|
|
$post['sendDistance'] = $sendDistance;
|
|
|
|