Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
Open sidebar
alpha
sun
Commits
65af1022
Commit
65af1022
authored
Aug 05, 2019
by
王浩
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'haow/dev' into 'test'
fix code See merge request
!282
parents
112c30cd
db396e88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
reply.py
api/reply.py
+12
-8
No files found.
api/reply.py
View file @
65af1022
...
...
@@ -8,14 +8,14 @@ class ReplyListView(APIView):
def
get
(
self
,
request
):
page
=
int
(
request
.
GET
.
get
(
'page'
,
1
))
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
))
id_
=
int
(
request
.
GET
.
get
(
'id'
,
0
)
)
id_
=
request
.
GET
.
get
(
'id'
,
None
)
content
=
request
.
GET
.
get
(
'content'
,
None
)
topic_content
=
request
.
GET
.
get
(
'topic_content'
,
None
)
user_name
=
request
.
GET
.
get
(
'user_name'
,
None
)
belong_type
=
request
.
GET
.
get
(
'belong_type'
,
None
)
reply_level
=
request
.
GET
.
get
(
'reply_level'
,
None
)
reply_user_type
=
int
(
request
.
GET
.
get
(
'reply_user_type'
,
0
)
)
replied_user_type
=
int
(
request
.
GET
.
get
(
'replied_user_type'
,
0
)
)
reply_user_type
=
request
.
GET
.
get
(
'reply_user_type'
,
None
)
replied_user_type
=
request
.
GET
.
get
(
'replied_user_type'
,
None
)
is_online
=
request
.
GET
.
get
(
'is_online'
,
None
)
from_create_time
=
request
.
GET
.
get
(
'from_create_time'
,
None
)
to_create_time
=
request
.
GET
.
get
(
'to_create_time'
,
None
)
...
...
@@ -25,10 +25,14 @@ class ReplyListView(APIView):
other_filters
=
{}
if
topic_content
:
other_filters
[
'topic_content'
]
=
topic_content
if
reply_user_type
and
reply_user_type
in
[
USER_EXTRA_TYPE
.
REAL
,
USER_EXTRA_TYPE
.
SHADOW
,
USER_EXTRA_TYPE
.
KOL
]:
other_filters
[
'reply_user_type'
]
=
reply_user_type
if
replied_user_type
and
replied_user_type
in
[
USER_EXTRA_TYPE
.
REAL
,
USER_EXTRA_TYPE
.
SHADOW
,
USER_EXTRA_TYPE
.
KOL
]:
other_filters
[
'replied_user_type'
]
=
replied_user_type
if
reply_user_type
:
reply_user_type
=
int
(
reply_user_type
)
if
reply_user_type
in
[
USER_EXTRA_TYPE
.
REAL
,
USER_EXTRA_TYPE
.
SHADOW
,
USER_EXTRA_TYPE
.
KOL
]:
other_filters
[
'reply_user_type'
]
=
reply_user_type
if
replied_user_type
:
replied_user_type
=
int
(
replied_user_type
)
if
replied_user_type
in
[
USER_EXTRA_TYPE
.
REAL
,
USER_EXTRA_TYPE
.
SHADOW
,
USER_EXTRA_TYPE
.
KOL
]:
other_filters
[
'replied_user_type'
]
=
replied_user_type
if
from_topic_create_time
and
to_topic_create_time
:
other_filters
[
'topic_create_time__gte'
]
=
from_topic_create_time
other_filters
[
'topic_create_time__lte'
]
=
to_topic_create_time
...
...
@@ -36,7 +40,7 @@ class ReplyListView(APIView):
other_filters
[
'user_name'
]
=
user_name
filters
=
{}
if
id_
:
filters
[
'id'
]
=
i
d_
filters
[
'id'
]
=
i
nt
(
id_
)
if
content
:
filters
[
'content__contains'
]
=
content
if
belong_type
:
...
...
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