|
|
|
@ -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]); |
|
|
|
|
} |
|
|
|
|