Просмотр исходного кода

삭제된 문서는 안 나오게

Surplus_Up (2DU) 6 лет назад
Родитель
Сommit
eceef5c4f2
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      route/list_old_page.py

+ 4 - 3
route/list_old_page.py

@@ -12,9 +12,10 @@ def list_old_page_2(conn):
     div = '<ul>'
     
     curs.execute('' + \
-        'select title, date from history ' + \
-        "where title not like 'user:%' and title not like 'category:%' and title not like 'file:%' " + \
-        'group by title '
+        'select title, date from history h ' + \
+        "where title not like 'user:%' and title not like 'category:%' and title not like 'file:%' and " + \
+        "exists (select title from data where title = h.title) " + \
+        'group by title ' + \
         'order by date asc ' + \
         'limit ?, "50"' + \
     '', [str(sql_num)])