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

Commit 2a80221f by 李景熙

修改任务显示顺序:时间晚的在前

parent 535f09f4
......@@ -55,7 +55,7 @@ def judge_completed(taskid, user_id):
def find_task_by_name(task_name, start, num):
try:
find = Task.select(Task.task_id, Task.task_name, Task.publish_id, Task.publish_time).where(
Task.task_name.contains(task_name))
Task.task_name.contains(task_name)).order_by(Task.task_id.desc())
index = 0
list = []
while index + start < len(find) and index < num:
......@@ -79,7 +79,7 @@ def find_task_by_name(task_name, start, num):
# 查找所有任务(用于任务大厅界面)
def find_task(start, num):
try:
find = Task.select(Task.task_id, Task.task_name, Task.publish_id, Task.publish_time)
find = Task.select(Task.task_id, Task.task_name, Task.publish_id, Task.publish_time).order_by(Task.task_id.desc())
index = 0
list = []
while index + start < len(find) and index < num:
......@@ -104,7 +104,7 @@ def find_task(start, num):
def find_task_by_creator(creator, start, num):
try:
find = Task.select(Task.task_id, Task.task_name, Task.publish_id, Task.publish_time, Task.task_state).where(
Task.publish_id == creator, Task.task_state == 0 and 1)
Task.publish_id == creator, Task.task_state == 0 and 1).order_by(Task.task_id.desc())
index = 0
list = []
while index + start < len(find) and index < num:
......@@ -134,7 +134,7 @@ def find_task_by_creator(creator, start, num):
def find_task_check(creator, start, num):
try:
find = Task.select(Task.task_id, Task.task_name, Task.publish_id, Task.publish_time).where(
Task.publish_id == creator, Task.task_state == 2)
Task.publish_id == creator, Task.task_state == 2).order_by(Task.task_id.desc())
index = 0
list = []
while index + start < len(find) and index < num:
......@@ -161,7 +161,7 @@ def find_task_completed(executor, start, num):
slice_list = Relation.find_slice_by_completed(executor)
task_list = Slice.find_task_by_slicelist(slice_list)
find = Task.select(Task.task_id, Task.task_name, Task.publish_id, Task.publish_time).where(
Task.task_id << task_list)
Task.task_id << task_list).order_by(Task.task_id.desc())
index = 0
list = []
while index + start < len(find) and index < num:
......@@ -189,7 +189,7 @@ def find_task_my_task(executor, start, num):
slice_list = Relation.find_slice_by_executor(executor)
task_list = Slice.find_task_by_slicelist(slice_list)
find = Task.select(Task.task_id, Task.task_name, Task.publish_id, Task.publish_time).where(
Task.task_id << task_list)
Task.task_id << task_list).order_by(Task.task_id.desc())
index = 0
list = []
while index + start < len(find) and index < num:
......
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