创建分类

main
ztt 9 months ago
parent ea351b82a7
commit e054ade5db
  1. 10
      addons/shopro/service/order/OrderCreate.php

@ -38,6 +38,8 @@ class OrderCreate
*/
protected $address_id = 0;
protected $warehouse_id = 0;
/**
* 选择的收货地址信息
*/
@ -153,6 +155,8 @@ class OrderCreate
$this->coupon_id = $params['coupon_id'] ?? 0;
$this->remark = $params['remark'] ?? '';
$this->warehouse_id = $params['warehouse_id'] ?? 0;
$this->money = (isset($params['money']) && $params['money'] > 0) ? $params['money'] : 0;
// 获取商品信息
@ -273,7 +277,9 @@ class OrderCreate
$this->exception("请选择正确的收货地址");
}
} elseif(in_array('shopZt', $dispatchTypes)) {
if (!$this->warehouse_id) {
$this->exception("请选择正确的自提地址");
}
} {
// 不需要收货地址
$this->need_address = 0;
@ -1105,7 +1111,7 @@ class OrderCreate
$orderData['coupon_id'] = $result['coupon'] ? $result['coupon']['id'] : 0;
$orderData['status'] = Order::STATUS_UNPAID;
$orderData['platform'] = request()->header('platform');
$orderData['warehouse_id'] = $result['warehouse_id'];//添加自提地址
$orderData['warehouse_id'] = $this->warehouse_id;//添加自提地址

Loading…
Cancel
Save