update2022
This commit is contained in:
@@ -9,6 +9,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use PhpOffice\PhpWord\Exception\CopyFileException;
|
||||
use PhpOffice\PhpWord\Exception\CreateTemporaryFileException;
|
||||
use PhpOffice\PhpWord\TemplateProcessor;
|
||||
use RuntimeException;
|
||||
|
||||
class DestroyData extends RowAction
|
||||
{
|
||||
@@ -24,7 +25,7 @@ class DestroyData extends RowAction
|
||||
{
|
||||
try {
|
||||
if ($model->archives) {
|
||||
// return $this->response()->error('数据销毁失败')->refresh();
|
||||
// return $this->response()->error('数据销毁失败')->refresh();
|
||||
}
|
||||
// 先做存档
|
||||
$archives = [];
|
||||
@@ -47,10 +48,10 @@ class DestroyData extends RowAction
|
||||
$download = $this->exportEqual($model);
|
||||
}
|
||||
|
||||
// $model->logs()->delete();
|
||||
$model->logs()->delete();
|
||||
|
||||
return $this->response()->success('数据销毁完成')->refresh()->download($download);
|
||||
} catch (\RuntimeException $exception) {
|
||||
} catch (RuntimeException $exception) {
|
||||
return $this->response()->error('数据销毁失败'.$exception->getMessage())->refresh();
|
||||
}
|
||||
}
|
||||
@@ -69,8 +70,8 @@ class DestroyData extends RowAction
|
||||
{
|
||||
$templateProcessor = new TemplateProcessor(storage_path('app/public/DENG_FEN.docx'));
|
||||
|
||||
$templateProcessor->setValue('TOTAL1', $vote->logs()->distinct('user_id')->count());
|
||||
$templateProcessor->setValue('TITLE', $vote->title);
|
||||
$templateProcessor->setValue('TOTAL', $vote->logs()->distinct('user_id')->count());
|
||||
$templateProcessor->setValue('TITLE', strip_tags($vote->title));
|
||||
|
||||
$i = 0;
|
||||
$tpl = '';
|
||||
|
||||
Reference in New Issue
Block a user