service = app('OwnerProcessSettlementBillService'); $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); $this->archiveService = app('OwnerBillReportArchiveService'); $isArchived = $this->archiveService->isArchived($counting_month, $owner_id, $this->service::TYPE); $request = $this->buildRequest($request, $counting_month,$owner_id); return view('finance.settlementBills.processFee.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, "加工费"); } }