|
@@ -235,11 +235,12 @@ def getAllTask():
|
|
|
values += f'{k}="{v}" and '
|
|
|
sql = f"select task_id from crawler_author_map where {values[:-4]} and is_del=1" # [:-1]是为了去掉末尾的逗号
|
|
|
res = mysql_con.get_values(sql)
|
|
|
+
|
|
|
task_list = list()
|
|
|
for author_info in res:
|
|
|
task_id = author_info['task_id']
|
|
|
- sql = f'select task_name, source, task_type, create_task_user, insert_time, update_task_user, update_time from crawler_task where task_id={task_id} order by update_time desc limit {start_count}, {end_count}'
|
|
|
- task_info = mysql_con.get_values(sql)
|
|
|
+ sql = f'select * from crawler_task where task_id={task_id} order by update_time desc limit {start_count}, {end_count}'
|
|
|
+ task_info = mysql_con.get_values(sql)[0]
|
|
|
task_data = dict(
|
|
|
task_id=task_info['task_id'],
|
|
|
task_name=task_info['task_name'],
|
|
@@ -254,7 +255,7 @@ def getAllTask():
|
|
|
|
|
|
return jsonify({'code': 200, 'data': task_list})
|
|
|
|
|
|
- sql = f"""select task_id, task_name, source, task_type, create_task_user, insert_time, update_task_user, update_time from crawler_task order by update_time desc limit {start_count}, {end_count} """
|
|
|
+ sql = f"""select * from crawler_task order by update_time desc limit {start_count}, {end_count} """
|
|
|
result = mysql_con.get_values(sql)
|
|
|
if not result:
|
|
|
return jsonify({'code': '200', 'result': [], 'message': '没有更多任务'})
|