Quellcode durchsuchen

Update User\UpdateCountTopics

Visman vor 3 Jahren
Ursprung
Commit
4c9cc34c41
1 geänderte Dateien mit 4 neuen und 3 gelöschten Zeilen
  1. 4 3
      app/Models/User/UpdateCountTopics.php

+ 4 - 3
app/Models/User/UpdateCountTopics.php

@@ -23,7 +23,10 @@ class UpdateCountTopics extends Action
     {
     {
         $ids = [];
         $ids = [];
         foreach ($args as $arg) {
         foreach ($args as $arg) {
-            if ($arg instanceof User) {
+            if (
+                $arg instanceof User
+                && ! $arg->isGuest
+            ) {
                 $ids[$arg->id] = true;
                 $ids[$arg->id] = true;
             } elseif (
             } elseif (
                 \is_int($arg)
                 \is_int($arg)
@@ -34,8 +37,6 @@ class UpdateCountTopics extends Action
                 throw new InvalidArgumentException('Expected user or positive integer id');
                 throw new InvalidArgumentException('Expected user or positive integer id');
             }
             }
         }
         }
-        // темы гостя не считаем
-        unset($ids[0]); // ????
 
 
         if (empty($ids)) {
         if (empty($ids)) {
             $where = '::users.id > 0';
             $where = '::users.id > 0';