diff --git a/addons/shopro/controller/order/Order.php b/addons/shopro/controller/order/Order.php index f48cfbb..343d581 100755 --- a/addons/shopro/controller/order/Order.php +++ b/addons/shopro/controller/order/Order.php @@ -2,6 +2,7 @@ namespace addons\shopro\controller\order; +use app\admin\model\Warehouse; use think\Db; use addons\shopro\controller\Common; use addons\shopro\service\order\OrderCreate; @@ -122,6 +123,11 @@ class Order extends Common $orderCreate = new OrderCreate($params); $result = $orderCreate->calc(); + //添加商品自提地址 + $result['zt_list'] = (new Warehouse()) + ->where('id', 'in', $result['goods_list'][0]['goods']['warehouse_ids']) + ->select(); + if (isset($result['msg']) && $result['msg']) { $this->error($result['msg'], 1, $result); } else { diff --git a/addons/shopro/service/order/OrderCreate.php b/addons/shopro/service/order/OrderCreate.php index 7e2dcf5..73f3633 100755 --- a/addons/shopro/service/order/OrderCreate.php +++ b/addons/shopro/service/order/OrderCreate.php @@ -272,7 +272,9 @@ class OrderCreate if (is_null($this->userAddress) && $this->calc_type == 'create') { $this->exception("请选择正确的收货地址"); } - } else { + } elseif(in_array('shopZt', $dispatchTypes)) { + + } { // 不需要收货地址 $this->need_address = 0; } @@ -1103,6 +1105,9 @@ class OrderCreate $orderData['coupon_id'] = $result['coupon'] ? $result['coupon']['id'] : 0; $orderData['status'] = Order::STATUS_UNPAID; $orderData['platform'] = request()->header('platform'); + $orderData['warehouse_id'] = 1;//添加自提地址 + + $ext = $result['promo_infos'] ? ['promo_infos' => $result['promo_infos']] : []; // 促销活动信息 if ($this->activity['activity']) { diff --git a/application/admin/model/shopro/order/WarehouseAddress.php b/application/admin/model/shopro/order/WarehouseAddress.php new file mode 100755 index 0000000..477708b --- /dev/null +++ b/application/admin/model/shopro/order/WarehouseAddress.php @@ -0,0 +1,19 @@ +