input(); $this->service = app('OwnerLogisticFeeReportService'); $this->userService = app('UserService'); $permittingOwnerIds = $this->userService->getPermittingOwnerIds(auth()->user()); if (is_null($request->year) || is_null($request->month)) { $date = now()->subMonth()->startOfMonth()->toDateString(); } else { $date = $request->year . '-' . $request->month . '-' . '01'; } if (is_null($request->owner_id)) { $owner_id = $permittingOwnerIds[0]; }else{ $owner_id = $request->owner_id; } $reports = $this->service->getRecordPagination($owner_id, $date, $paginateParams); $recordTotal = $this->service->getRecordTotal($owner_id, $date); $owner = Owner::query()->selectRaw("name")->find($owner_id); $owners = Owner::query()->selectRaw("id,name")->whereIn('id', $permittingOwnerIds)->get(); return view('finance.settlementBills.logisticFee.report.index', compact('reports', 'recordTotal', 'paginateParams', 'owners','owner')); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { // } /** * Display the specified resource. * * @param \App\OwnerLogisticFeeReport $ownerLogisticFeeReport * @return \Illuminate\Http\Response */ public function show(OwnerLogisticFeeReport $ownerLogisticFeeReport) { // } /** * Show the form for editing the specified resource. * * @param \App\OwnerLogisticFeeReport $ownerLogisticFeeReport * @return \Illuminate\Http\Response */ public function edit(OwnerLogisticFeeReport $ownerLogisticFeeReport) { // } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param \App\OwnerLogisticFeeReport $ownerLogisticFeeReport * @return \Illuminate\Http\Response */ public function update(Request $request, OwnerLogisticFeeReport $ownerLogisticFeeReport) { // } /** * Remove the specified resource from storage. * * @param \App\OwnerLogisticFeeReport $ownerLogisticFeeReport * @return \Illuminate\Http\Response */ public function destroy(OwnerLogisticFeeReport $ownerLogisticFeeReport) { // } }