浏览代码

Update BanList\GetList

Change the name of the creator of the ban and its id if this user is deleted.
Visman 4 年之前
父节点
当前提交
c053b72c9c
共有 2 个文件被更改,包括 6 次插入1 次删除
  1. 5 0
      app/Models/BanList/GetList.php
  2. 1 1
      app/Models/Pages/Admin/Bans.php

+ 5 - 0
app/Models/BanList/GetList.php

@@ -25,6 +25,11 @@ class GetList extends Method
         $list = \array_fill_keys($ids, false);
         $list = \array_fill_keys($ids, false);
 
 
         while ($row = $stmt->fetch()) {
         while ($row = $stmt->fetch()) {
+            if (null === $row['name_creator']) {
+                $row['name_creator'] = 'User #' . $row['id_creator'];
+                $row['id_creator']   = 1;
+            }
+
             $list[$row['id']] = $row;
             $list[$row['id']] = $row;
         }
         }
 
 

+ 1 - 1
app/Models/Pages/Admin/Bans.php

@@ -474,7 +474,7 @@ class Bans extends Admin
                         'id'   => $ban['id_creator'],
                         'id'   => $ban['id_creator'],
                         'name' => $ban['name_creator'],
                         'name' => $ban['name_creator'],
                     ]
                     ]
-                ), // ????
+                ),
             ];
             ];
             $fields[] = [
             $fields[] = [
                 'type' => 'endwrap',
                 'type' => 'endwrap',