getIdArr(); if (is_null($year)) { $year = now()->subMonth()->year; } if (is_null($month)) { $month = now()->subMonth()->month; } $counting_month = \Carbon\Carbon::parse($year . '-' . $month . '-' . '01')->toDateString(); if (is_null($owner_id)) { $owner_id = $permittingOwnerIds[0]; } return array($permittingOwnerIds, $counting_month, $owner_id); } /** * @param Request $request * @param $counting_month * @param $owner_id * @return Collection|\Tightenco\Collect\Support\Collection */ public function buildRequest(Request $request, $counting_month,$owner_id) { $request = $request->all(); $request['year'] = \Carbon\Carbon::parse($counting_month)->year; $request['month'] = \Carbon\Carbon::parse($counting_month)->month; $request['owner_id'] = $owner_id; return collect($request); } public function confirmBill(Request $request): \Illuminate\Http\RedirectResponse { list($permittingOwnerIds, $counting_month, $owner_id) = $this->getRequestParams($request->year, $request->month, $request->owner_id); $this->service->confirmBill($counting_month, $owner_id); return back()->with('success', '确认成功'); } }