archiveService = app('OwnerBillReportArchiveService'); $this->service = app('OwnerStoreFeeDetailService'); } /** * Display a listing of the resource. * */ public function index(Request $request) { $paginateParams = $request->input(); list($permittingOwnerIds, $counting_month, $owner_id) = $this->getRequestParams($request->year, $request->month, $request->owner_id); $details = $this->service->get([ 'counting_month' => $counting_month, 'owner_id' => $owner_id, 'type' => $this->service::TYPE, 'paginateParams' => $paginateParams, ]); $owners = Owner::query()->selectRaw("id,name")->whereIn('id', $permittingOwnerIds)->get(); $owner = Owner::query()->selectRaw("name,id")->find($owner_id); $request = $this->buildRequest($request, $counting_month,$owner_id); return view('finance.settlementBills.storeFee.detail.index', compact('details', 'paginateParams', 'owners', 'owner', 'request')); } public function export(Request $request) { $this->service = app('OwnerStoreFeeDetailService'); list($permittingOwnerIds, $counting_month, $owner_id) = $this->getRequestParams($request->year, $request->month, $request->owner_id); $query = $this->service->getSql($counting_month, $owner_id); if (!$request->exists('checkAllSign')) { $query->whereIn('id', explode(',', $request['data'])); } $details = $query->get(); $json = $this->service->buildExport($details); $row = ['作业日期', '作业名称', '入库单号', '商品条码', '商品名称', '数量', '单价', '入库费']; return Export::make($row, $json, "入库费明细"); } }