execute(function () use ($request, $reports) { $data = $request->validate([ 'page' => ['nullable', 'integer', 'min:1'], 'limit' => ['nullable', 'integer', 'min:1', 'max:20'], 'username' => ['nullable', 'string', 'max:64'], 'start_date' => ['required', 'date_format:Y-m-d'], 'end_date' => ['required', 'date_format:Y-m-d', 'after_or_equal:start_date'], ]); return $reports->reportRows($this->currentAgent(), $data); }); } /** 周期报表:按日 / 周 / 月汇总。合营:名下会员;入股:全平台。只有汇总,没有会员明细。 */ public function period(Request $request, AgentPeriodReportService $reports) { return $this->execute(function () use ($request, $reports) { $data = $request->validate([ 'period' => ['nullable', 'in:day,week,month'], 'start_date' => ['nullable', 'date_format:Y-m-d'], 'end_date' => ['nullable', 'date_format:Y-m-d', 'after_or_equal:start_date'], ]); return $reports->report($this->currentAgent(), $data); }); } }