statisticsService = $statisticsService; } /** * 获取统计概览 */ public function overview(Request $request) { try { $this->data['data'] = $this->statisticsService->getOverview($request); } catch (\Throwable $th) { $this->data['code'] = 0; $this->data['message'] = $th->getMessage(); } return response()->json($this->data); } /** * 获取收支趋势 */ public function trend(Request $request) { try { $this->data['data'] = $this->statisticsService->getTrend($request); } catch (\Throwable $th) { $this->data['code'] = 0; $this->data['message'] = $th->getMessage(); } return response()->json($this->data); } /** * 获取分类统计 */ public function category(Request $request) { try { $this->data['data'] = $this->statisticsService->getCategory($request); } catch (\Throwable $th) { $this->data['code'] = 0; $this->data['message'] = $th->getMessage(); } return response()->json($this->data); } /** * 获取月度报表 */ public function monthly(Request $request) { try { $this->data['data'] = $this->statisticsService->getMonthly($request); } catch (\Throwable $th) { $this->data['code'] = 0; $this->data['message'] = $th->getMessage(); } return response()->json($this->data); } /** * 获取年度报表 */ public function yearly(Request $request) { try { $this->data['data'] = $this->statisticsService->getYearly($request); } catch (\Throwable $th) { $this->data['code'] = 0; $this->data['message'] = $th->getMessage(); } return response()->json($this->data); } }