lgy 2 weeks ago
parent
commit
a8f4d02919

+ 3 - 3
jcjyhr/app/admin/controller/auth/AdminLog.php

@@ -14,9 +14,9 @@ class AdminLog extends Backend
      */
     protected object $model;
 
-    protected string|array $preExcludeFields = ['create_time', 'admin_id', 'username'];
+    protected string|array $preExcludeFields = ['CREATE_TIME', 'ADMIN_ID', 'USERNAME'];
 
-    protected string|array $quickSearchField = ['title'];
+    protected string|array $quickSearchField = ['TITLE'];
 
     public function initialize(): void
     {
@@ -36,7 +36,7 @@ class AdminLog extends Backend
 
         list($where, $alias, $limit, $order) = $this->queryBuilder();
         if (!$this->auth->isSuperAdmin()) {
-            $where[] = ['admin_id', '=', $this->auth->id];
+            $where[] = ['ADMIN_ID', '=', $this->auth->id];
         }
         $res = $this->model
             ->withJoin($this->withJoinTable, $this->withJoinType)

+ 7 - 7
jcjyhr/app/admin/model/AdminLog.php

@@ -143,13 +143,13 @@ class AdminLog extends Model
             $title           = $controllerTitle ? ($controllerTitle . '-' . $title) : $title;
         }
         self::create([
-            'admin_id'  => $adminId,
-            'username'  => $username,
-            'url'       => substr(request()->url(), 0, 1500),
-            'title'     => $title,
-            'data'      => !is_scalar($data) ? json_encode($data) : $data,
-            'ip'        => request()->ip(),
-            'useragent' => substr(request()->server('HTTP_USER_AGENT'), 0, 255),
+            'ADMIN_ID'  => $adminId,
+            'USERNAME'  => $username,
+            'URL'       => substr(request()->url(), 0, 1500),
+            'TITLE'     => $title,
+            'DATA'      => !is_scalar($data) ? json_encode($data) : $data,
+            'IP'        => request()->ip(),
+            'USERAGENT' => substr(request()->server('HTTP_USER_AGENT'), 0, 255),
         ]);
     }
 

+ 1 - 1
jcjyhr/app/admin/model/DataRecycleLog.php

@@ -22,6 +22,6 @@ class DataRecycleLog extends Model
 
     public function admin(): BelongsTo
     {
-        return $this->belongsTo(Admin::class, 'admin_id');
+        return $this->belongsTo(Admin::class, 'ADMIN_ID');
     }
 }

+ 1 - 1
jcjyhr/app/admin/model/SensitiveDataLog.php

@@ -22,6 +22,6 @@ class SensitiveDataLog extends Model
 
     public function admin(): BelongsTo
     {
-        return $this->belongsTo(Admin::class, 'admin_id');
+        return $this->belongsTo(Admin::class, 'ADMIN_ID');
     }
 }