SettlementIndemnityFeeController.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Owner;
  4. use App\Services\OwnerBillReportArchiveService;
  5. use App\Services\SettlementIndemnityFeeService;
  6. use Illuminate\Http\Request;
  7. class SettlementIndemnityFeeController extends Controller implements \App\Interfaces\SettlementBillControllerInterface
  8. {
  9. use \App\Traits\SettlementBillTrait;
  10. /** @var SettlementIndemnityFeeService $service */
  11. private $service;
  12. /** @var OwnerBillReportArchiveService $archiveService */
  13. private $archiveService;
  14. /**
  15. * OwnerDischargeTaskSettlementBillController constructor.
  16. */
  17. public function __construct()
  18. {
  19. $this->service = app('SettlementIndemnityFeeService');
  20. $this->archiveService = app('OwnerBillReportArchiveService');
  21. }
  22. //
  23. public function index(Request $request)
  24. {
  25. $paginateParams = $request->input();
  26. list($permittingOwnerIds, $counting_month, $owner_id) = $this->getRequestParams($request->year, $request->month, $request->owner_id);
  27. $details = $this->service->get([
  28. 'counting_month' => $counting_month,
  29. 'owner_id' => $owner_id,
  30. 'paginateParams' => $paginateParams,
  31. ]);
  32. $owners = Owner::query()->selectRaw("id,name")->whereIn('id', $permittingOwnerIds)->get();
  33. $owner = Owner::query()->selectRaw("name,id")->find($owner_id);
  34. $isArchived = $this->archiveService->isArchived($counting_month, $owner_id, $this->service::TYPE);
  35. $request = $this->buildRequest($request, $counting_month,$owner_id);
  36. return view('finance.settlementBills.indemnityFee.index', compact('details', 'paginateParams', 'owners', 'owner', 'request', 'isArchived'));
  37. }
  38. public function export(Request $request)
  39. {
  40. }
  41. }