From ccb07803a81823c55774cdd96a62ef8919943296 Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Thu, 17 Sep 2020 21:06:49 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=81=E8=BE=BE=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/v3/Implementations/AppointmentTimeService.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Service/v3/Implementations/AppointmentTimeService.php b/app/Service/v3/Implementations/AppointmentTimeService.php index 3ce10c4..a59b7ce 100644 --- a/app/Service/v3/Implementations/AppointmentTimeService.php +++ b/app/Service/v3/Implementations/AppointmentTimeService.php @@ -37,6 +37,9 @@ class AppointmentTimeService implements AppointmentTimeServiceInterface $shopcartIds = explode(',',$shopcartIds); $sotreIds = ShoppingCart::query()->whereIn('id',$shopcartIds)->pluck('store_id'); $stores = Store::query()->whereIn('id',$sotreIds)->get()->toArray(); + if(empty($stores)){ + throw new ErrorCodeException(ErrorCode::STORE_NOT_AVAILABLE); + } $time1Arr = []; $time2Arr = []; $time3Arr = []; @@ -97,6 +100,7 @@ class AppointmentTimeService implements AppointmentTimeServiceInterface if($nowTime > $startTime){ $startTime = ceil($nowTime / (30*60)) * (30*60); } + //if(isset($closedTime) && ) //高峰段 区间 $peakPeriod = strtotime('16:00'); $peakPeriodEnd = strtotime('18:00');