Browse Source

营业时间

master
Lemon 5 years ago
parent
commit
ba58595e94
  1. 4
      app/Constants/v3/ErrorCode.php
  2. 3
      app/Controller/v3/StoreController.php
  3. 3
      app/Service/v3/Implementations/BusinessHoursService.php
  4. 2
      app/Service/v3/Interfaces/BusinessHoursServiceInterface.php

4
app/Constants/v3/ErrorCode.php

@ -278,8 +278,8 @@ class ErrorCode extends AbstractConstants
const LOCATION_ERROR = 1301;
/**
* 定位失败
* @Message("超出配送范围")
* 超出配送范围
* @Message("您的地址超出配送范围,请重新选择地址")
*/
const LOCATION_LONG_DISTANCE= 1302;
}

3
app/Controller/v3/StoreController.php

@ -66,11 +66,12 @@ class StoreController extends BaseController
public function updateBusinessHours()
{
$storeId = $this->request->input('store_id');
$isRest = $this->request->input('is_rest','');
$time1 = $this->request->input('time1','');
$time2 = $this->request->input('time2','');
$time3 = $this->request->input('time3','');
$time4 = $this->request->input('time4','');
$res = $this->businessHoursService->do($storeId,$time1,$time2,$time3,$time4);
$res = $this->businessHoursService->do($storeId,$isRest,$time1,$time2,$time3,$time4);
return $this->success($res);
}
}

3
app/Service/v3/Implementations/BusinessHoursService.php

@ -8,9 +8,10 @@ use \App\Service\v3\Interfaces\BusinessHoursServiceInterface;
class BusinessHoursService implements BusinessHoursServiceInterface
{
public function do($storeId,$time1,$time2,$time3 = '',$time4 = '')
public function do($storeId,$isRest,$time1,$time2,$time3 = '',$time4 = '')
{
$store = Store::query()->find($storeId);
$store->is_rest = $isRest;
$store->time1 = $time1;
$store->time2 = $time2;
$store->time3 = $time3;

2
app/Service/v3/Interfaces/BusinessHoursServiceInterface.php

@ -6,7 +6,7 @@ namespace App\Service\v3\Interfaces;
interface BusinessHoursServiceInterface
{
public function do($storeId,$time1,$time2,$time3 = '',$time4 = '');
public function do($storeId,$isRest,$time1,$time2,$time3 = '',$time4 = '');
public function check($storeId);
public function undo();
}
Loading…
Cancel
Save