service = app('OwnerLogisticFeeDetailService'); $this->archiveService = app('OwnerBillReportArchiveService'); } /** * 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([ 'owner_id' => $owner_id, 'counting_month' => $counting_month, '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'); $request = $this->buildRequest($request, $counting_month,$owner_id); return view('finance.settlementBills.expressFee.detail.index', compact('details', 'paginateParams', 'owners', 'owner', 'request')); } 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 = $this->service->buildExport($query->get()); $json = []; foreach ($details as $detail) { $json[] = array_values($detail); } $row = ['主键', '快递公司', '省份', '快递单号', '重量', '首重价格', '续重价格', '快递费',]; return Export::make($row, $json, "快递费用详情"); } }