request->all(); $data = $this->storeService->detail($params['store_id']); if(empty($data)){ $msg = ['plat'=>'/v3/store/index/',"data"=>$params]; throw new ErrorCodeException(ErrorCode::STORE_NOT_AVAILABLE,'',$msg); } $data['is_collected'] = (bool)$this->collectService->check($params['user_id'],$params['store_id']); $data['goods_types'] = $this->categoryService->allForStore($params['store_id']); $data['in_business'] = $this->storeService->check($params['store_id']); if($data['in_business'] === true) { $data['in_business_text'] = '营业中'; }else{ $data['in_business_text'] = '休息中'; } return $this->success(['store' => $data]); } public function getBusinessHours() { $storeId = $this->request->input('store_id'); $res = $this->businessHoursService->check($storeId); return $this->success($res); } 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,$isRest,$time1,$time2,$time3,$time4); return $this->success($res); } public function getGoodsByType() { $storeId = $this->request->input('store_id'); $typeId = $this->request->input('type_id',''); $goods = $this->goodsService->getByType($storeId,$typeId); return $this->success($goods); } public function getList() { $userId = $this->request->input('user_id'); $page = $this->request->input('page',1); $pagesize = $this->request->input('pagesize',10); $employees = Employees::query() ->where('user_id',$userId) ->whereJsonContains('position', '30') ->first(); if(empty($employees)){ return $this->success(['personnel' => false]); } $res = $this->storeService->getList($employees->market_id,$page,$pagesize); return $this->success($res); } public function getCategory() { $storeId = $this->request->input('store_id'); $res = $data['goods_types'] = $this->categoryService->allForStoreIncludeOff($storeId); return $this->success(['goods_types' => $res]); } public function getListByMarketId() { $marketId = $this->request->input('market_id'); $page = $this->request->input('page',1); $pagesize = $this->request->input('pagesize',10); $res = $this->storeService->getListByMarketId($marketId,$page,$pagesize); return $this->success($res); } public function updateIsRest() { $storeId = $this->request->input('store_id'); $res = $this->storeService->updateIsRest($storeId); return $this->success($res); } }