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
80187017
Commit
80187017
authored
Jun 24, 2020
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
退款同时修改代理商收入
parent
e44c720d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
Controller/RentController.py
+6
-2
Model/Production/ProductionModel.py
+3
-0
Model/Rent/RentModel.py
+1
-0
No files found.
Controller/RentController.py
View file @
80187017
...
...
@@ -370,14 +370,17 @@ def rent_money_refund():
# 重新计算订单对应所有讲解器总收入,退款金额
rent_total
=
0
rent_real_total
=
0
rent_agent_total
=
0
productions
=
Production
.
query
.
filter_by
(
rent_id
=
rent
.
id
)
.
all
()
for
tmp
in
productions
:
if
tmp
.
id
==
production
.
id
:
rent_total
+=
new_total
rent_real_total
+=
new_total
rent_agent_total
+=
new_total
else
:
rent_total
+=
tmp
.
total
rent_real_total
+=
tmp
.
total
rent_agent_total
+=
tmp
.
agent_total
rent_back_money
=
rent
.
deposit
*
rent
.
number
-
rent_total
...
...
@@ -388,8 +391,7 @@ def rent_money_refund():
"total_fee"
:
rent_info
.
Rent
.
deposit
*
rent_info
.
Rent
.
number
,
"refund_fee"
:
refund_money
}
# result = WeChatService().refund(data)
result
=
True
result
=
WeChatService
()
.
refund
(
data
)
if
result
:
try
:
rent_refund
=
RentRefund
()
...
...
@@ -400,9 +402,11 @@ def rent_money_refund():
rent
.
total
=
rent_total
rent
.
real_total
=
rent_real_total
rent
.
agent_total
=
rent_agent_total
rent
.
back_money
=
rent_back_money
production
.
total
=
new_total
production
.
agent_total
=
new_total
db
.
session
.
add
(
rent_refund
)
db
.
session
.
add
(
rent
)
...
...
Model/Production/ProductionModel.py
View file @
80187017
...
...
@@ -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
=
'退款时间'
)
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 @
80187017
...
...
@@ -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预约'
)
...
...
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