request->all(); //判断是否已收藏店铺 $exists = $this->collectStoreService->check($params['user_id'],$params['store_id']); //如果已收藏则删除 if($exists){ $this->collectStoreService->undo($params['user_id'],$params['store_id']); }else{ $this->collectStoreService->do($params['user_id'],$params['store_id']); } $res = (bool) $this->collectStoreService->check($params['user_id'],$params['store_id']); return $this->success(['is_collect' => $res]); } public function getListByUser(UserRequest $request) { $params = $this->request->all(); $res = $this->collectStoreService->getListByUser($params['user_id']); return $this->success($res); } }