paginate($request->input()); $owners=app("ownerService")->getSelection(); $processMethods=app("processMethodService")->getSelection(); return view('process.statistic',['processStatistics'=>$processStatistics,'owners'=>$owners,'processMethods'=>$processMethods]); } public function export(Request $request){ if(!Gate::allows('二次加工管理-查询')){ return '没有权限'; } if ($request->checkAllSign){ $params = $request->input(); unset($params['checkAllSign']); $sql = app('processStatisticService')->getSql($params); }else $sql = app('processStatisticService')->getSql(["process_id"=>$request->data]); $post = Http::post(config('go.export.url'),['type'=>'processStatistic','sql'=>$sql]); if ($post->status() == 500){ throw new Exception($post->header("Msg")); } return response($post,200, [ "Content-type"=>"application/octet-stream", "Content-Disposition"=>"attachment; filename=二次加工统计记录-".date('ymdHis').'.xlsx', ]); } }