Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tour_business
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
魏强
tour_business
Commits
abb82ccf
Commit
abb82ccf
authored
Jun 23, 2020
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代理商收入查看修改
parent
0753af61
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
11 deletions
+16
-11
Model/Production/ProductionModel.py
+4
-1
Model/Rent/RentModel.py
+1
-0
Service/IndexService.py
+5
-4
Service/RentService.py
+6
-6
No files found.
Model/Production/ProductionModel.py
View file @
abb82ccf
...
...
@@ -17,9 +17,12 @@ class Production(BaseModel):
return_machine_id
=
Column
(
Integer
,
comment
=
'还的机柜id'
)
return_hatch_no
=
Column
(
Integer
,
comment
=
'还的仓口'
)
return_time
=
Column
(
DateTime
,
comment
=
'还的时间'
)
agent_return_time
=
Column
(
DateTime
,
comment
=
'代理商看的归还的时间'
)
is_refund
=
Column
(
Integer
,
nullable
=
False
,
server_default
=
FetchedValue
(),
comment
=
'是否退款'
)
refund_no
=
Column
(
String
(
191
,
'utf8mb4_unicode_ci'
),
comment
=
'退款单号'
)
refund_time
=
Column
(
DateTime
,
comment
=
'退款时间'
)
refund_time
=
Column
(
DateTime
,
comment
=
'代理商看的退款的时间'
)
agent_refund_time
=
Column
(
DateTime
,
comment
=
'退款时间'
)
total
=
Column
(
Integer
,
comment
=
'消费金额'
)
agent_total
=
Column
(
Integer
,
comment
=
'代理商看的收入'
)
spot_id
=
Column
(
Integer
,
nullable
=
False
,
comment
=
'景点id'
)
business_id
=
Column
(
Integer
,
nullable
=
False
,
comment
=
'商家id'
)
Model/Rent/RentModel.py
View file @
abb82ccf
...
...
@@ -17,6 +17,7 @@ class Rent(BaseModel):
customer_id
=
Column
(
Integer
,
nullable
=
False
,
comment
=
'用户id'
)
total
=
Column
(
Integer
,
nullable
=
False
,
server_default
=
FetchedValue
(),
comment
=
'应收金额'
)
real_total
=
Column
(
Integer
,
nullable
=
False
,
server_default
=
FetchedValue
(),
comment
=
'实收金额'
)
agent_total
=
Column
(
Integer
,
nullable
=
False
,
server_default
=
FetchedValue
(),
comment
=
'代理商看的收入'
)
back_money
=
Column
(
Integer
,
nullable
=
False
,
server_default
=
FetchedValue
(),
comment
=
'退款金额'
)
is_pay
=
Column
(
Integer
,
nullable
=
False
,
server_default
=
FetchedValue
(),
comment
=
'是否支付'
)
rent_type
=
Column
(
Integer
,
nullable
=
False
,
server_default
=
FetchedValue
(),
comment
=
'租借类型1现场租借2预约'
)
...
...
Service/IndexService.py
View file @
abb82ccf
...
...
@@ -20,12 +20,13 @@ class IndexService():
:return:
'''
income_info
=
db
.
session
.
query
(
Production
.
total
)
.
filter
(
Production
.
spot_id
==
spot_id
,
Production
.
total
>
0
,
Production
.
created_at
>=
start_time
,
Production
.
created_at
<=
end_time
)
.
all
()
income_info
=
db
.
session
.
query
(
Production
.
agent_total
)
.
filter
(
Production
.
spot_id
==
spot_id
,
Production
.
total
>
0
,
Production
.
created_at
>=
start_time
,
Production
.
created_at
<=
end_time
)
.
all
()
total
=
0
for
info
in
income_info
:
total
+=
info
.
total
total
+=
info
.
agent_
total
return
round
(
total
/
100
,
2
),
len
(
income_info
)
@staticmethod
...
...
Service/RentService.py
View file @
abb82ccf
...
...
@@ -30,7 +30,7 @@ class RentService():
cur_info
=
{}
cur_info
[
'rent_no'
]
=
info
.
Rent
.
rent_no
cur_info
[
'hatch_no'
]
=
info
.
Production
.
rent_hatch_no
cur_info
[
'total'
]
=
0
if
info
.
Production
.
total
is
None
else
info
.
Production
.
total
cur_info
[
'total'
]
=
0
if
info
.
Production
.
agent_total
is
None
else
info
.
Production
.
agent_
total
if
info
.
Production
.
is_return
==
1
:
if
cur_info
[
'total'
]
<=
0
:
if
info
.
Production
.
return_hatch_no
==
127
:
...
...
@@ -60,7 +60,7 @@ class RentService():
tmp
=
{
'rent_no'
:
info
.
Rent
.
rent_no
,
'hatch_no'
:
info
.
Production
.
rent_hatch_no
,
'total'
:
0
if
info
.
Production
.
total
is
None
else
info
.
Production
.
total
,
'total'
:
0
if
info
.
Production
.
agent_total
is
None
else
info
.
Production
.
agent_
total
,
'status'
:
0
}
data
.
append
(
tmp
)
...
...
@@ -80,7 +80,7 @@ class RentService():
cur_info
=
{}
cur_info
[
'rent_no'
]
=
info
.
Rent
.
rent_no
cur_info
[
'hatch_no'
]
=
info
.
Production
.
rent_hatch_no
cur_info
[
'total'
]
=
0
if
info
.
Production
.
total
is
None
else
info
.
Production
.
total
cur_info
[
'total'
]
=
0
if
info
.
Production
.
agent_total
is
None
else
info
.
Production
.
agent_
total
if
info
.
Production
.
is_return
==
1
:
if
cur_info
[
'total'
]
<=
0
:
if
info
.
Production
.
return_hatch_no
==
127
:
...
...
@@ -145,8 +145,8 @@ class RentService():
def
get_production_detail_new
(
rent_no
,
hatch_no
):
print
(
'production_Detail'
)
sql
=
'''
SELECT rent.deposit, rent.is_over, production.is_return, production.total, production.return_hatch_no,
production.rent_machine_id, rent.customer_id, rent.real_total, rent.rent_no, production.return_time,
SELECT rent.deposit, rent.is_over, production.is_return, production.
agent_total as
total, production.return_hatch_no,
production.rent_machine_id, rent.customer_id, rent.
agent_total as
real_total, rent.rent_no, production.return_time,
rent.free_time, rent.one_day_price, rent.pay_time, rent.spot_id, production.is_refund, production.refund_no,
rent_refund.refund_no AS rent_refund_no FROM rent
LEFT JOIN production ON production.rent_id = rent.id
...
...
@@ -245,7 +245,7 @@ class RentService():
@staticmethod
def
get_search_info_
(
key_word
,
page
,
limit
):
sql
=
'''
SELECT rent.rent_no, rent.rent_type, rent.machine_id, rent.is_pay, rent.is_over, production.rent_hatch_no, production.total, production.is_return,
SELECT rent.rent_no, rent.rent_type, rent.machine_id, rent.is_pay, rent.is_over, production.rent_hatch_no, production.
agent_total as
total, production.is_return,
production.return_hatch_no, customers.phone, rent.pay_time FROM rent
LEFT JOIN production ON production.rent_id = rent.id
LEFT JOIN customers ON customers.id = rent.customer_id
...
...
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