文档服务地址: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): ...@@ -48,8 +48,8 @@ def judge_completed(taskid, user_id):
ret = Slice.find_slice_by_judge(taskid, user_id) ret = Slice.find_slice_by_judge(taskid, user_id)
list = ret.data list = ret.data
for item in list: for item in list:
completedNum = item['completed_num'] completedNum = item['completedNum']
totalNum = item['total_num'] totalNum = item['totalNum']
if completedNum != totalNum: if completedNum != totalNum:
return 0 return 0
return 1 return 1
...@@ -170,15 +170,16 @@ def find_task_completed(executor, start, num): ...@@ -170,15 +170,16 @@ def find_task_completed(executor, start, num):
list = [] list = []
while index + start < len(find) and index < num: while index + start < len(find) and index < num:
user = User.get_username(find[index + start].publish_id) user = User.get_username(find[index + start].publish_id)
list.append( if judge_completed(find[index + start].task_id, executor):
{ list.append(
'id': find[index + start].task_id, {
'creator': user, 'id': find[index + start].task_id,
'creator_id': find[index + start].publish_id, 'creator': user,
'name': find[index + start].task_name, 'creator_id': find[index + start].publish_id,
'date': find[index + start].publish_time.strftime("%Y-%m-%d %H:%M:%S") 'name': find[index + start].task_name,
} 'date': find[index + start].publish_time.strftime("%Y-%m-%d %H:%M:%S")
) }
)
index += 1 index += 1
except: except:
return Result(0, "find failed", {}, 0) return Result(0, "find failed", {}, 0)
...@@ -269,5 +270,6 @@ def set_state(task_id, state): ...@@ -269,5 +270,6 @@ def set_state(task_id, state):
if __name__ == '__main__': if __name__ == '__main__':
# print(find_task_my_task(1,1,1)) # print(find_task_my_task(1,1,1))
Task.drop_table() # Task.drop_table()
Task.create_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