diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2023-05-18 05:28:36 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2023-05-18 05:28:36 +0300 |
commit | 5d739c3e9d73e13ad836df904a88debacce31db0 (patch) | |
tree | de8592200a2cf8a8f8913b37cc84919c8b04b79d /src/home/database | |
parent | 2960f9f09a9991e342a676999e498b08affa4dff (diff) |
openwrt: server side
Diffstat (limited to 'src/home/database')
-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( |