This commit is contained in:
2022-05-04 15:43:47 +08:00
parent c76a1850a1
commit 769b276649
2 changed files with 7 additions and 5 deletions

View File

@@ -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'));