文档服务地址:http://47.92.0.57:3000/ 周报索引地址:http://47.92.0.57:3000/s/NruNXRYmV

Commit 25aced6a by 李景熙

修改已完成任务列表显示逻辑

parent 615d36b8
......@@ -48,8 +48,8 @@ def judge_completed(taskid, user_id):
ret = Slice.find_slice_by_judge(taskid, user_id)
list = ret.data
for item in list:
completedNum = item['completed_num']
totalNum = item['total_num']
completedNum = item['completedNum']
totalNum = item['totalNum']
if completedNum != totalNum:
return 0
return 1
......@@ -170,15 +170,16 @@ def find_task_completed(executor, start, num):
list = []
while index + start < len(find) and index < num:
user = User.get_username(find[index + start].publish_id)
list.append(
{
'id': find[index + start].task_id,
'creator': user,
'creator_id': find[index + start].publish_id,
'name': find[index + start].task_name,
'date': find[index + start].publish_time.strftime("%Y-%m-%d %H:%M:%S")
}
)
if judge_completed(find[index + start].task_id, executor):
list.append(
{
'id': find[index + start].task_id,
'creator': user,
'creator_id': find[index + start].publish_id,
'name': find[index + start].task_name,
'date': find[index + start].publish_time.strftime("%Y-%m-%d %H:%M:%S")
}
)
index += 1
except:
return Result(0, "find failed", {}, 0)
......@@ -269,5 +270,6 @@ def set_state(task_id, state):
if __name__ == '__main__':
# print(find_task_my_task(1,1,1))
Task.drop_table()
Task.create_table()
# Task.drop_table()
# Task.create_table()
print(judge_completed(49, 1))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment