diff --git a/app/Controller/v3/OrderOnlineController.php b/app/Controller/v3/OrderOnlineController.php index f1e5c2c..5a5b89e 100644 --- a/app/Controller/v3/OrderOnlineController.php +++ b/app/Controller/v3/OrderOnlineController.php @@ -110,9 +110,9 @@ class OrderOnlineController extends BaseController $deliveryDistance = config('distance.delivery_distance'); if(isset($distance) && $distance < $deliveryDistance){ if($distance >= 1000){ - $distance_text = '距你收货地址 ' . bcdiv($distance,1000,2) . 'km'; + $distance_text = '距 ' . bcdiv($distance,1000,2) . 'km'; }else{ - $distance_text = '距你收货地址 ' . $distance . 'm'; + $distance_text = '距 ' . $distance . 'm'; } $distributionPrice = $this->distributionPriceService->do($distance); $res['location'] = [ @@ -120,8 +120,7 @@ class OrderOnlineController extends BaseController 'distribution_price' => $distributionPrice, 'distance' => $distance, 'within' => true, - // 'distribution_text' => '¥ '.$distributionPrice .'(' .$distance_text .')' - 'distribution_text' => $distance_text + 'distribution_text' => '¥ '.$distributionPrice .'(' .$distance_text .')' ]; }else{ $res['location'] = [ @@ -133,12 +132,9 @@ class OrderOnlineController extends BaseController ]; } //返回预约送达时间 数组 - $ret = $retSelfTake = $this->appointmentTimeService->get($shopcartIds); + $ret = $this->appointmentTimeService->get($shopcartIds); array_unshift($ret,['title'=>'尽快送达','value'=>'尽快送达']); $res['appointment_time'] = $ret; - - array_unshift($retSelfTake,['title'=>'尽快取货','value'=>'尽快取货']); - $res['appointment_time_self_take'] = $retSelfTake; $res['store_list'] = $this->shopCartService->getGoodsByShopcartId($shopcartIds); //获取用户优惠券 @@ -174,10 +170,6 @@ class OrderOnlineController extends BaseController $total = bcadd($total,$res['value_added_service']['price'],2); $total = bcadd($total,$res['location']['distribution_price'],2); $res['total'] = $total; - - // 新增返回市场信息 - $res['market'] = $market; - return $this->success($res); } diff --git a/app/Service/v3/Implementations/CollectStoreService.php b/app/Service/v3/Implementations/CollectStoreService.php index 72e07b0..8ecbe1d 100644 --- a/app/Service/v3/Implementations/CollectStoreService.php +++ b/app/Service/v3/Implementations/CollectStoreService.php @@ -66,22 +66,16 @@ class CollectStoreService implements CollectStoreServiceInterface //获取用户收藏店铺数量 public function countByUser($userId) { - - return UserCollection::query()->where(['user_id' => $userId])->count(); - - // $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); - // $count = $ssdb->exec('get',SsdbKeys::COUNT_COLLECT_STORE_USER.$userId); - // return $count; + $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); + $count = $ssdb->exec('get',SsdbKeys::COUNT_COLLECT_STORE_USER.$userId); + return $count; } //获取店铺被收藏数量 public function countByStore($storeId) { - - return UserCollection::query()->where(['store_id' => $storeId])->count(); - - // $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); - // $count = $ssdb->exec('get',SsdbKeys::COUNT_COLLECT_STORE.$storeId); - // return $count; + $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); + $count = $ssdb->exec('get',SsdbKeys::COUNT_COLLECT_STORE.$storeId); + return $count; } public function getListByUser($userId) diff --git a/app/Service/v3/Implementations/OrderOnlineService.php b/app/Service/v3/Implementations/OrderOnlineService.php index 21f0226..d55b658 100644 --- a/app/Service/v3/Implementations/OrderOnlineService.php +++ b/app/Service/v3/Implementations/OrderOnlineService.php @@ -14,7 +14,6 @@ use App\Exception\ErrorCodeException; use App\Model\v3\Coupon; use App\Model\v3\Goods; use App\Model\v3\GoodsActivity; -use App\Model\v3\Market; use App\Model\v3\Order; use App\Model\v3\OrderGoods; use App\Model\v3\OrderMain; @@ -141,21 +140,18 @@ class OrderOnlineService implements OrderOnlineServiceInterface $shippingType = Shipping::TYPE_SELF_TAKE; // 如果非自提,则通过用户地址计算相关数据和费用 - if ($selfTake != 1) { + // if ($selfTake != 1) { // 用户收货地址 // 获取配送费用 $userAddrAndDPrice = $this->userAddressService->getAddressAndDistributionPrice($userAddrId, $marketId); $userAddr = $userAddrAndDPrice['address']['address']; $deliveryAmount = $userAddrAndDPrice['distribution_price']; $deliveryDistance = $userAddrAndDPrice['delivery_distance']; + // $shippingType = Shipping::TYPE_LANZU; + // } + + if ($selfTake != 1) { $shippingType = Shipping::TYPE_LANZU; - } else { - $market = Market::query()->find($marketId); - $userAddr->tel = $market->tel; - $userAddr->address = $market->address ; - $userAddr->user_name = $market->name; - $userAddr->lat = $market->lat; - $userAddr->lng = $market->lng; } // 优惠券数据,当前订单可用个优惠券