Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mancheng
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mancheng
Commits
f258418f
Commit
f258418f
authored
Apr 04, 2023
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20230404
parent
6d1656ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
18 deletions
+38
-18
apps/view_xiaocx/view.py
+38
-18
No files found.
apps/view_xiaocx/view.py
View file @
f258418f
...
...
@@ -517,24 +517,44 @@ def consultation_list():
try
:
cons_obj_list
=
CustomerConsultation
.
query
.
paginate
(
page
,
perpage
)
.
items
cons_count
=
CustomerConsultation
.
query
.
count
()
data
=
[{
"id"
:
cons_obj
.
id
,
"project_name"
:
cons_obj
.
project_name
,
"investor"
:
cons_obj
.
investor
,
"investor_place"
:
cons_obj
.
investor_place
,
"project_type"
:
cons_obj
.
project_type
,
"investment_volume"
:
cons_obj
.
investment_volume
,
"basic_information"
:
cons_obj
.
basic_information
,
"land_area"
:
cons_obj
.
land_area
,
"linkman"
:
cons_obj
.
linkman
,
"link_mobile"
:
cons_obj
.
link_mobile
,
"flag"
:
cons_obj
.
flag
,
"reply_content"
:
cons_obj
.
reply_content
,
"consultation_time"
:
cons_obj
.
consultation_time
,
"reply_time"
:
cons_obj
.
reply_time
,
}
for
cons_obj
in
cons_obj_list
]
data
=
sorted
(
data
,
key
=
lambda
x
:
x
[
'consultation_time'
],
reverse
=
True
)
data_li
=
[]
for
cons_obj
in
cons_obj_list
:
print
(
cons_obj
)
data
=
{
"id"
:
cons_obj
.
id
,
"project_name"
:
cons_obj
.
project_name
,
"investor"
:
cons_obj
.
investor
,
"investor_place"
:
cons_obj
.
investor_place
,
"project_type"
:
cons_obj
.
project_type
,
"investment_volume"
:
cons_obj
.
investment_volume
,
"basic_information"
:
cons_obj
.
basic_information
,
"land_area"
:
cons_obj
.
land_area
,
"linkman"
:
cons_obj
.
linkman
,
"link_mobile"
:
cons_obj
.
link_mobile
,
"flag"
:
cons_obj
.
flag
,
"reply_content"
:
cons_obj
.
reply_content
,
"consultation_time"
:
cons_obj
.
consultation_time
.
strftime
(
"
%
Y-
%
m-
%
d"
)
if
cons_obj
.
consultation_time
else
""
,
"reply_time"
:
cons_obj
.
reply_time
.
strftime
(
"
%
Y-
%
m-
%
d"
)
if
cons_obj
.
reply_time
else
""
,
}
data_li
.
append
(
data
)
# data = [{
# "id": cons_obj.id,
# "project_name": cons_obj.project_name,
# "investor": cons_obj.investor,
# "investor_place": cons_obj.investor_place,
# "project_type": cons_obj.project_type,
# "investment_volume": cons_obj.investment_volume,
# "basic_information": cons_obj.basic_information,
# "land_area": cons_obj.land_area,
# "linkman": cons_obj.linkman,
# "link_mobile": cons_obj.link_mobile,
# "flag": cons_obj.flag,
# "reply_content": cons_obj.reply_content,
# "consultation_time": cons_obj.consultation_time.strftime("%Y-%m-%d") if cons_obj.consultation_time else "",
# "reply_time": cons_obj.reply_time.strftime("%Y-%m-%d") if cons_obj.reply_time else "",
# } for cons_obj in cons_obj_list]
data
=
sorted
(
data_li
,
key
=
lambda
x
:
x
[
"consultation_time"
],
reverse
=
True
)
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
return
jsonify
(
code
=
RET
.
SESSIONERR
,
msg
=
"Query error!"
)
...
...
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