From 769b276649aca04ae50e1c51a1e6a37db370577f Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 4 May 2022 15:43:47 +0800 Subject: [PATCH] update --- app/Admin/Actions/DestroyData.php | 7 ++++--- app/Admin/Actions/ExportCha.php | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Admin/Actions/DestroyData.php b/app/Admin/Actions/DestroyData.php index 4657395..8c673ab 100644 --- a/app/Admin/Actions/DestroyData.php +++ b/app/Admin/Actions/DestroyData.php @@ -3,6 +3,7 @@ namespace App\Admin\Actions; use App\Models\User; +use Encore\Admin\Actions\Response; use Encore\Admin\Actions\RowAction; use Illuminate\Database\Eloquent\Model; use PhpOffice\PhpWord\Exception\CopyFileException; @@ -19,11 +20,11 @@ class DestroyData extends RowAction $this->confirm('确定要销毁数据么,一旦操作不可恢复?'); } - public function handle(Model $model) + public function handle(Model $model): Response { try { if ($model->archives) { - // return $this->response()->error('数据销毁失败')->refresh(); + // return $this->response()->error('数据销毁失败')->refresh(); } // 先做存档 $archives = []; @@ -64,7 +65,7 @@ class DestroyData extends RowAction * @throws CopyFileException * @throws CreateTemporaryFileException */ - public function exportEqual($vote) + public function exportEqual($vote): string { $templateProcessor = new TemplateProcessor(storage_path('app/public/DENG_FEN.docx')); diff --git a/app/Admin/Actions/ExportCha.php b/app/Admin/Actions/ExportCha.php index 13975e1..10738f1 100644 --- a/app/Admin/Actions/ExportCha.php +++ b/app/Admin/Actions/ExportCha.php @@ -4,6 +4,7 @@ namespace App\Admin\Actions; use App\Models\Vote; use Encore\Admin\Actions\Action; +use Encore\Admin\Actions\Response; use Illuminate\Http\Request; use PhpOffice\PhpWord\TemplateProcessor; @@ -16,7 +17,7 @@ class ExportCha extends Action protected $selector = '.export-cha'; - public function handle(Request $request) + public function handle(Request $request): Response { $templateProcessor = new TemplateProcessor(storage_path('app/public/CHA_E.docx')); @@ -39,7 +40,7 @@ class ExportCha extends Action return $this->response()->success('倒出成功')->download('/storage/' . $save); } - public function html() + public function html(): string { return << 差额数据倒出