where('id', $template_id)->first(); // 报表名称 $report_name = "{$template['code']}"; $report_file = ''; if (is_file(public_path().'/reports/'.$report_name.'.mrt')) { $report_file = $report_name; } return $this->render(['report_name' => $report_name, 'report_file' => $report_file]); } public function viewer() { return $this->render(); } public function saveReport() { $gets = Request::all(); $fileName = $gets['fileName']; file_put_contents(public_path().'/reports/'.$fileName.".mrt", $gets['data']); $success = ['success' => true, 'msg' => "保存成功:".$fileName]; return $success; } }