|
|
@@ -26,13 +26,14 @@ use app\api\service\points\GoodsDeduct as PointsDeductService;
|
|
|
use app\api\service\order\source\checkout\Factory as CheckoutFactory;
|
|
|
|
|
|
use app\common\enum\Setting as SettingEnum;
|
|
|
-use app\common\library\helper;
|
|
|
use app\common\enum\order\PayType as OrderPayTypeEnum;
|
|
|
-use app\common\enum\order\DeliveryType as DeliveryTypeEnum;
|
|
|
+use app\common\enum\order\OrderStatus as OrderStatusEnum;
|
|
|
use app\common\enum\order\OrderSource as OrderSourceEnum;
|
|
|
+use app\common\enum\order\DeliveryType as DeliveryTypeEnum;
|
|
|
use app\common\service\BaseService;
|
|
|
use app\common\service\delivery\Express as ExpressService;
|
|
|
use app\common\service\goods\source\Factory as StockFactory;
|
|
|
+use app\common\library\helper;
|
|
|
use app\common\exception\BaseException;
|
|
|
|
|
|
/**
|
|
|
@@ -252,7 +253,7 @@ class Checkout extends BaseService
|
|
|
// 积分抵扣总数量
|
|
|
$this->orderData['pointsNum'] = $actualPointsNum;
|
|
|
// 允许积分抵扣
|
|
|
- $this->orderData['isAllowPoints'] = true;
|
|
|
+ $this->orderData['isAllowPoints'] = true;
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@@ -603,7 +604,7 @@ class Checkout extends BaseService
|
|
|
* 订单配送-快递配送
|
|
|
* @return bool
|
|
|
* @throws \think\db\exception\DataNotFoundException
|
|
|
- * @throws \think\db\exception\DbException
|
|
|
+ * @throws \think\db\exception\DbException
|
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
|
*/
|
|
|
private function setOrderExpress()
|
|
|
@@ -613,9 +614,9 @@ class Checkout extends BaseService
|
|
|
'expressPrice' => 0,
|
|
|
], true);
|
|
|
// 当前用户收货城市id
|
|
|
- $cityId = $this->user['address_default'] ? (int)$this->user['address_default']['city_id'] : 0;
|
|
|
+ $cityId = $this->user['address_default'] ? (int)$this->user['address_default']['city_id'] : 0;
|
|
|
// 初始化配送服务类
|
|
|
- $ExpressService = new ExpressService($cityId, $this->goodsList);
|
|
|
+ $ExpressService = new ExpressService($cityId, $this->goodsList);
|
|
|
// 验证商品是否在配送范围
|
|
|
$isIntraRegion = $ExpressService->isIntraRegion();
|
|
|
if ($cityId > 0 && $isIntraRegion == false) {
|
|
|
@@ -755,10 +756,11 @@ class Checkout extends BaseService
|
|
|
'order_source' => $this->orderSource['source'],
|
|
|
'order_source_id' => $this->orderSource['source_id'],
|
|
|
'points_bonus' => $order['pointsBonus'],
|
|
|
+ 'order_status' => OrderStatusEnum::NORMAL,
|
|
|
'store_id' => $this->storeId,
|
|
|
];
|
|
|
if ($order['delivery'] == DeliveryTypeEnum::EXPRESS) {
|
|
|
- $data['expressPrice'] = $order['expressPrice'];
|
|
|
+ $data['express_price'] = $order['expressPrice'];
|
|
|
}
|
|
|
// 保存订单记录
|
|
|
return $this->model->save($data);
|