Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DA-Platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
文档服务地址:
http://47.92.0.57:3000/
周报索引地址:
http://47.92.0.57:3000/s/NruNXRYmV
Open sidebar
Berlin
DA-Platform
Commits
54c5081e
Commit
54c5081e
authored
Sep 14, 2020
by
李景熙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
任务大厅三标签搜索
parent
c5745d82
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
Task.py
DAPlatform/dao/Task.py
+27
-1
No files found.
DAPlatform/dao/Task.py
View file @
54c5081e
...
@@ -85,12 +85,38 @@ def find_task(start, num, keyword, creatorName, taskType):
...
@@ -85,12 +85,38 @@ def find_task(start, num, keyword, creatorName, taskType):
else
:
else
:
find
=
Task
.
select
(
Task
.
task_id
,
Task
.
task_name
,
Task
.
publish_id
,
Task
.
publish_time
,
Task
.
task_state
)
.
where
(
find
=
Task
.
select
(
Task
.
task_id
,
Task
.
task_name
,
Task
.
publish_id
,
Task
.
publish_time
,
Task
.
task_state
)
.
where
(
Task
.
task_state
<=
1
)
.
order_by
(
Task
.
task_id
.
desc
())
Task
.
task_state
<=
1
)
.
order_by
(
Task
.
task_id
.
desc
())
# typeList记录哪种类型被要求,typeList[type]=1表示被要求
typeList
=
[
0
]
*
3
for
typeItem
in
taskType
:
if
typeItem
==
"文本"
:
typeList
[
0
]
=
1
elif
typeItem
==
"图片"
:
typeList
[
1
]
=
1
else
:
typeList
[
2
]
=
1
findLen
=
len
(
find
)
# flagList记录find中哪个task下存在typeList[type]=1的分片
flagList
=
[
0
]
*
findLen
if
taskType
:
if
taskType
:
print
(
taskType
)
i
=
0
while
i
<
findLen
:
taskId
=
find
[
i
]
.
task_id
sliceList
=
Slice
.
find_slicelist_by_taskId
(
taskId
)
for
sliceItem
in
sliceList
:
sliceType
=
int
(
sliceItem
.
type
)
if
typeList
[
sliceType
]
==
1
:
flagList
[
i
]
=
1
break
i
+=
1
else
:
flagList
=
[
1
]
*
findLen
# 根据taskType数组内容挑选task结果,task Type是一个数组['文本', '图片', '图层'],最多只有这三个元素
# 根据taskType数组内容挑选task结果,task Type是一个数组['文本', '图片', '图层'],最多只有这三个元素
index
=
0
index
=
0
list
=
[]
list
=
[]
while
index
+
start
<
len
(
find
)
and
index
<
num
:
while
index
+
start
<
len
(
find
)
and
index
<
num
:
if
flagList
[
index
]
==
1
:
user
=
User
.
get_username
(
find
[
index
+
start
]
.
publish_id
)
user
=
User
.
get_username
(
find
[
index
+
start
]
.
publish_id
)
list
.
append
(
list
.
append
(
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment