Browse Source

Update BanList\GetList

Change the name of the creator of the ban and its id if this user is deleted.
Visman 4 years ago
parent
commit
c053b72c9c
2 changed files with 6 additions and 1 deletions
  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);
 
         while ($row = $stmt->fetch()) {
+            if (null === $row['name_creator']) {
+                $row['name_creator'] = 'User #' . $row['id_creator'];
+                $row['id_creator']   = 1;
+            }
+
             $list[$row['id']] = $row;
         }
 

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

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