service = app('OwnerDischargeTaskSettlementBillService'); $this->archiveService = app('OwnerBillReportArchiveService'); } public function index(Request $request) { $paginateParams = $request->input(); list($permittingOwnerIds, $counting_month, $owner_id) = $this->getRequestParams($request->year, $request->month, $request->owner_id); list($details, $totalFee) = $this->service->get([ 'counting_month' => $counting_month, 'owner_id' => $owner_id, 'paginateParams' => $paginateParams, ]); $owners = Owner::query()->selectRaw("id,name")->whereIn('id', $permittingOwnerIds)->get(); $owner = Owner::query()->selectRaw("name,id")->find($owner_id); $isArchived = $this->archiveService->isArchived($counting_month, $owner_id, $this->service::TYPE); $request = $this->buildRequest($request, $counting_month,$owner_id); return view('finance.settlementBills.unloadFee.index', compact('details', 'paginateParams', 'owners', 'owner', 'request', 'isArchived', 'totalFee')); } public function export(Request $request) { list($permittingOwnerIds, $counting_month, $owner_id) = $this->getRequestParams($request->year, $request->month, $request->owner_id); $query = $this->service->getSql($owner_id, $counting_month); if (!$request->exists('checkAllSign')) { $query->whereIn('id', explode(',', $request['data'])); } $details = $query->get(); $json = $this->service->buildExport($details); $row = ['日期', '作业类型', '入库单号', '数量', '单位', '单价', '收费', '收入描述', '支出吗描述']; return Export::make($row, $json, "卸货费"); } }