|
|
@@ -55,12 +55,8 @@ class OrderController extends BaseController
|
|
|
$bookMobile = isset($post['bookMobile']) && !empty($post['bookMobile']) && stringUtil::isMobile($post['bookMobile']) ? $post['bookMobile'] : '';
|
|
|
$bookMobile = empty($bookMobile) && isset($user['mobile']) && !empty($user['mobile']) ? $user['mobile'] : $bookMobile;
|
|
|
$post['bookMobile'] = $bookMobile;
|
|
|
-
|
|
|
$post['payWay'] = $this->isWx == true ? 0 : 1;
|
|
|
- $defaultShopId = MerchantService::getDefaultShopId($this->sj);
|
|
|
- if (empty($defaultShopId)) {
|
|
|
- util::fail('没有找到门店');
|
|
|
- }
|
|
|
+
|
|
|
//计算运费
|
|
|
$post['sendDistance'] = isset($post['sendDistance']) ? $post['sendDistance'] : 0;
|
|
|
$sendCost = 0;
|
|
|
@@ -68,12 +64,12 @@ class OrderController extends BaseController
|
|
|
if ($freightType == 0 && $needSend == 1) {
|
|
|
$lat = $post['latitude'];//收货人纬度
|
|
|
$lng = $post['longitude'];//收货人经度
|
|
|
- $respond = ExpressService::getUserDistance($lng, $lat, $defaultShopId, $this->sjExtend);
|
|
|
+ $respond = ExpressService::getUserDistance($lng, $lat, $this->shopId, $this->sjExtend);
|
|
|
$sendCost = isset($respond['fee']) ? $respond['fee'] : 0;
|
|
|
}
|
|
|
$post['sendCost'] = $sendCost;
|
|
|
$post['merchantId'] = $this->sjId;
|
|
|
- $post['shopId'] = $defaultShopId;
|
|
|
+ $post['shopId'] = $this->shopId;
|
|
|
|
|
|
//计算总金额
|
|
|
$unitPrice = $goodsInfo['price'];
|
|
|
@@ -425,7 +421,7 @@ class OrderController extends BaseController
|
|
|
$post = Yii::$app->request->post();
|
|
|
$id = $post['id'];
|
|
|
$order = OrderService::getById($id);
|
|
|
- OrderService::valid($order, $this->customId);
|
|
|
+ OrderService::valid($order, $this->shopId);
|
|
|
if ($order['grade'] > 0) {
|
|
|
util::fail('您已经评过了');
|
|
|
}
|
|
|
@@ -445,7 +441,7 @@ class OrderController extends BaseController
|
|
|
if (!empty($orderSn)) {
|
|
|
$detail = OrderService::getOrderBySn($orderSn);
|
|
|
}
|
|
|
- OrderService::valid($detail, $this->customId);
|
|
|
+ OrderService::valid($detail, $this->shopId);
|
|
|
util::success($detail);
|
|
|
}
|
|
|
|