beanRepository = $beanRepository; } //获取指定时间彩虹豆收支明细 public function beanDetail(Request $request) { $validator = Validator::make($request->all(), [ 'type' => ['required',Rule::in([0,1, 2])], ]); if ($validator->fails()) { return $this->jsonError($validator->errors()->first()); } $beanDetail = $this->beanRepository->beanDetail($request->all()); if ($beanDetail){ return $this->jsonSuccess($beanDetail); }else{ return $this->jsonError('没有找到对应彩虹豆明细'); } } //获取星球-用户彩虹豆相关信息 public function getBean(Request $request) { $user_bean = $this->beanRepository->getBean($request->all()); if ($user_bean){ return $this->jsonSuccess($user_bean); }else{ return $this->jsonError('没有找到星球彩虹豆信息'); } } //昨日优秀居民 public function excellentResidents(Request $request) { $excellent_residents = $this->beanRepository->excellentResidents($request->all()); if ($excellent_residents){ return $this->jsonSuccess($excellent_residents); }else{ return $this->jsonError('没有找到昨日优秀居民相关信息'); } } //排行榜 public function rankingList(Request $request) { $validator = Validator::make($request->all(), [ 'type' => ['required',Rule::in([0,1, 2])], ]); if ($validator->fails()) { return $this->jsonError($validator->errors()->first()); } $top_most = $this->beanRepository->rankingList($request->all()); if ($top_most){ return $this->jsonSuccess($top_most); }else{ return $this->jsonError('没有找到排行榜相关信息'); } } }