feature/main20240421
郭嘉 6 months ago
parent fcfc4b3adb
commit 5349d3c606
  1. 11
      app/api/controller/Checkout.php
  2. 1
      app/api/service/order/Checkout.php

@ -90,11 +90,12 @@ class Checkout extends Controller
(string)$params['goodsSkuId'],
(int)$params['goodsNum']
);
$merchantId = 0;
foreach ($goodsList as $g) {
$merchantId = $g['merchant_id'];
}
// 获取订单确认信息
$orderInfo = $Checkout->onCheckout($goodsList);
// echo "<pre>";
// print_r($orderInfo);
// exit();
if ($this->request->isGet()) {
return $this->renderSuccess([
'order' => $orderInfo,
@ -106,7 +107,9 @@ class Checkout extends Controller
if ($Checkout->hasError()) {
return $this->renderError($Checkout->getError(), ['isCreated' => false]);
}
// 创建订单
// 创建订单 增加订单
$orderInfo['merchantId'] = $merchantId;
//print_r($orderInfo);die;
if (!$Checkout->createOrder($orderInfo)) {
return $this->renderError($Checkout->getError() ?: '订单创建失败', ['isCreated' => false]);
}

@ -875,6 +875,7 @@ class Checkout extends BaseService
'order_status' => OrderStatusEnum::NORMAL,
'platform' => getPlatform(),
'store_id' => $this->storeId,
'merchant_id' => $order['merchantId'] ?? 0,
'expect_receive_time' => $this->param['expect_receive_time'],//期待收货时间
'is_street_take' => $this->param['is_street_take'],//是否街边1-在 0-不在
'to_store_time' => $this->param['to_store_time'],//预计到店时间

Loading…
Cancel
Save