소스 검색

Minor edits

Visman 1 년 전
부모
커밋
4bb906c300
5개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 1
      app/Models/Forum/LoadTree.php
  2. 1 1
      app/Models/Post/Feed.php
  3. 1 1
      app/Models/Search/Index.php
  4. 1 1
      app/Models/Topic/CalcStat.php
  5. 2 0
      app/Models/User/UpdateLastVisit.php

+ 1 - 1
app/Models/Forum/LoadTree.php

@@ -125,7 +125,7 @@ class LoadTree extends Action
         $query = 'SELECT t.forum_id, t.last_post
             FROM ::topics AS t
             LEFT JOIN ::mark_of_topic AS mot ON (mot.uid=?i:uid AND mot.tid=t.id)
-            WHERE t.forum_id IN(?ai:forums)
+            WHERE t.forum_id IN (?ai:forums)
                 AND t.moved_to=0
                 AND t.last_post>?i:max
                 AND (mot.mt_last_visit IS NULL OR t.last_post>mot.mt_last_visit)';

+ 1 - 1
app/Models/Post/Feed.php

@@ -58,7 +58,7 @@ class Feed extends Action
                 p.hide_smilies, p.posted, p.edited, t.id as tid, t.subject as topic_name, t.forum_id as fid
                 FROM ::posts AS p
                 INNER JOIN ::topics AS t ON t.id=p.topic_id
-                WHERE t.forum_id IN(?ai:forums)
+                WHERE t.forum_id IN (?ai:forums)
                 ORDER BY p.id DESC
                 LIMIT 50';
 

+ 1 - 1
app/Models/Search/Index.php

@@ -80,7 +80,7 @@ class Index extends Method
             ];
             $query = 'SELECT sw.word
                 FROM ::search_words AS sw
-                WHERE sw.word IN(?as:words)';
+                WHERE sw.word IN (?as:words)';
 
             $oldWords = $this->c->DB->query($query, $vars)->fetchAll(PDO::FETCH_COLUMN);
             $newWords = \array_diff($allWords, $oldWords);

+ 1 - 1
app/Models/Topic/CalcStat.php

@@ -53,7 +53,7 @@ class CalcStat extends Method
             ];
             $query = 'SELECT p.id, p.poster, p.poster_id, p.posted, p.edited
                 FROM ::posts AS p
-                WHERE p.id IN(?ai:ids)';
+                WHERE p.id IN (?ai:ids)';
 
             $result = $this->c->DB->query($query, $vars)->fetchAll(PDO::FETCH_UNIQUE);
 

+ 2 - 0
app/Models/User/UpdateLastVisit.php

@@ -24,6 +24,7 @@ class UpdateLastVisit extends Action
         if ($user->isGuest) {
             throw new RuntimeException('Expected user');
         }
+
         if ($user->logged > 0) {
             $vars = [
                 ':logged' => $user->logged,
@@ -34,6 +35,7 @@ class UpdateLastVisit extends Action
                 WHERE id=?i:id AND last_visit<?i:logged';
 
             $this->c->DB->exec($query, $vars);
+
             $user->__last_visit = $user->logged;
         }
     }