diff options
Diffstat (limited to 'src/home/database/bots.py')
-rw-r--r-- | src/home/database/bots.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/home/database/bots.py b/src/home/database/bots.py index 26fb170..cde48b9 100644 --- a/src/home/database/bots.py +++ b/src/home/database/bots.py @@ -85,14 +85,15 @@ class BotsDatabase(MySQLDatabase): def get_openwrt_logs(self, filter_text: str, min_id: int, + access_point: int, limit: int = None) -> List[OpenwrtLogRecord]: tz = pytz.timezone('Europe/Moscow') with self.cursor(dictionary=True) as cursor: - sql = "SELECT * FROM openwrt WHERE text LIKE %s AND id > %s" + sql = "SELECT * FROM openwrt WHERE ap=%s AND text LIKE %s AND id > %s" if limit is not None: sql += f" LIMIT {limit}" - cursor.execute(sql, (f'%{filter_text}%', min_id)) + cursor.execute(sql, (access_point, f'%{filter_text}%', min_id)) data = [] for row in cursor.fetchall(): data.append(OpenwrtLogRecord( |