This commit is contained in:
Jing Ling
2020-11-23 22:04:48 +08:00
parent 23bcd76bc3
commit 4fe646030d
+2 -1
View File
@@ -234,7 +234,7 @@ class Database(object):
table_name = table_name.replace('.', '_') table_name = table_name.replace('.', '_')
sql = f'select id, alive, request, resolve, url, subdomain, level,' \ sql = f'select id, alive, request, resolve, url, subdomain, level,' \
f'cname, ip, public, cdn, port, status, reason, title, banner,' \ f'cname, ip, public, cdn, port, status, reason, title, banner,' \
f'cidr, asn, org, addr, isp, source from "{table_name}" order by subdomain' f'cidr, asn, org, addr, isp, source from "{table_name}" '
if alive and limit: if alive and limit:
if limit in ['resolve', 'request']: if limit in ['resolve', 'request']:
where = f' where {limit} = 1' where = f' where {limit} = 1'
@@ -242,6 +242,7 @@ class Database(object):
elif alive: elif alive:
where = f' where alive = 1' where = f' where alive = 1'
sql += where sql += where
sql += ' order by subdomain'
logger.log('TRACE', f'Get the data from {table_name} table') logger.log('TRACE', f'Get the data from {table_name} table')
return self.query(sql) return self.query(sql)