| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <?php
- namespace App\Http\Controllers;
- use App\Owner;
- use App\OwnerLogisticFeeReport;
- use App\Services\OwnerLogisticFeeReportService;
- use App\Services\UserService;
- use Illuminate\Http\Request;
- class OwnerLogisticFeeReportController extends Controller
- {
- /* @var OwnerLogisticFeeReportService $service */
- private $service;
- /* @var UserService $userService */
- private $userService;
- /**
- * Display a listing of the resource.
- */
- public function index(Request $request)
- {
- $paginateParams = $request->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)
- {
- //
- }
- }
|