Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
Automat
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
1
Merge Requests
1
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
冯佳佳
Automat
Commits
10efc07b
Commit
10efc07b
authored
Feb 24, 2022
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
5188d3df
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
15 deletions
+4
-15
myapps/pc_management/api/rent_portal.py
+4
-15
No files found.
myapps/pc_management/api/rent_portal.py
View file @
10efc07b
...
@@ -557,25 +557,19 @@ def run_draw_list():
...
@@ -557,25 +557,19 @@ def run_draw_list():
select_sql
=
"""
select_sql
=
"""
select draw_record.draw_no,
select draw_record.draw_no,
draw_record.business_id,
draw_record.bill_date,
draw_record.bill_date,
draw_record.total,
draw_record.real_total,
draw_record.real_total,
draw_record.rate,
draw_record.status,
draw_record.status,
draw_record.draw_time,
draw_record.draw_time,
draw_record.created_at,
draw_record.created_at,
draw_record.updated_at,
draw_record.updated_at,
draw_record.id,
draw_record.id
business.business_name
"""
"""
count_sql
=
" select count(draw_record.id) as total_count "
count_sql
=
" select count(draw_record.id) as total_count "
from_sql
=
"""
from_sql
=
"""
FROM
FROM
draw_record
draw_record
LEFT JOIN
business ON draw_record.business_id = business.id
"""
"""
where_sql
=
" WHERE draw_record.status <> '-1' "
where_sql
=
" WHERE draw_record.status <> '-1' "
...
@@ -591,11 +585,6 @@ def run_draw_list():
...
@@ -591,11 +585,6 @@ def run_draw_list():
if
business_id
is
not
None
:
if
business_id
is
not
None
:
where_sql
+=
" and draw_record.business_id = '{}'"
.
format
(
business_id
)
where_sql
+=
" and draw_record.business_id = '{}'"
.
format
(
business_id
)
if
g
.
user
.
level
!=
1
:
where_sql
+=
""" and draw_record.business_id in (
select business_id from admin_business where user_id = '{}' and status = 1)
"""
.
format
(
g
.
user
.
id
)
order_sql
=
" ORDER BY draw_record.created_at DESC, draw_record.status asc"
order_sql
=
" ORDER BY draw_record.created_at DESC, draw_record.status asc"
limit_sql
=
" LIMIT {offset} , {page_size}"
.
format
(
offset
=
(
page
-
1
)
*
page_size
,
page_size
=
page_size
)
limit_sql
=
" LIMIT {offset} , {page_size}"
.
format
(
offset
=
(
page
-
1
)
*
page_size
,
page_size
=
page_size
)
...
@@ -612,9 +601,9 @@ def run_draw_list():
...
@@ -612,9 +601,9 @@ def run_draw_list():
if
result
:
if
result
:
for
info
in
result
:
for
info
in
result
:
tmp
=
{
tmp
=
{
"b
usiness_id"
:
info
.
business_id
,
"bill_date"
:
info
.
bill_date
,
"total"
:
info
.
total
,
"b
ill_date"
:
info
.
bill_date
,
"real_total"
:
info
.
real_total
,
"
rate"
:
info
.
rate
,
"
status"
:
info
.
status
,
"real_total"
:
info
.
real_total
,
"status"
:
info
.
status
,
"
business_name"
:
info
.
business_name
,
"
id"
:
info
.
id
,
"id"
:
info
.
id
,
"create_time"
:
info
.
created_at
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
),
"create_time"
:
info
.
created_at
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
),
"draw_time"
:
info
.
draw_time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
if
info
.
draw_time
else
""
,
"draw_time"
:
info
.
draw_time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
if
info
.
draw_time
else
""
,
}
}
...
...
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