You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
924 B
PHP
30 lines
924 B
PHP
<?php
|
|
|
|
namespace App\Services;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
class DeleteLogService
|
|
{
|
|
public function logDeletion($tableName, $recordId, $name, $idCardNum, $operatorId, $operatorName, $reason, $screenshot)
|
|
{
|
|
try {
|
|
DB::table('delete_operation_log')->insert([
|
|
'table_name' => $tableName,
|
|
'record_id' => $recordId,
|
|
'name' => $name,
|
|
'id_card_num' => $idCardNum,
|
|
'operator_id' => $operatorId,
|
|
'operator_name' => $operatorName,
|
|
'reason' => $reason,
|
|
'screenshot' => $screenshot,
|
|
'created_at' => date('Y-m-d H:i:s'),
|
|
'updated_at' => date('Y-m-d H:i:s'),
|
|
]);
|
|
} catch (\Exception $e) {
|
|
Log::error('删除操作日志写入失败: ' . $e->getMessage());
|
|
}
|
|
}
|
|
}
|