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
803caef7
Commit
803caef7
authored
Nov 26, 2021
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改库存上报接口
parent
da952b28
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
myapps/sukang24h/api/hatch_portal.py
+7
-3
myapps/sukang24h/api/rent_portal.py
+0
-1
No files found.
myapps/sukang24h/api/hatch_portal.py
View file @
803caef7
...
@@ -113,11 +113,15 @@ def run_hatch_open():
...
@@ -113,11 +113,15 @@ def run_hatch_open():
rent_detail
.
is_take
=
1
rent_detail
.
is_take
=
1
db
.
session
.
add
(
rent_detail
)
db
.
session
.
add
(
rent_detail
)
# 查询到柜子中的物品 数量减一
# 查询到柜子中的物品 数量减一
sql
=
"update earphone_hatch set left_count = left_count - 1 where machine_no = '{}' and hatch_no='{}'"
.
format
(
machine_no
,
hatch_no
)
db
.
session
.
execute
(
sql
)
db
.
session
.
commit
()
# 当数量小于等于1时,将柜子物品状态改为已售空
left_res
=
Hatch
.
query
.
filter
(
Hatch
.
hatch_no
==
hatch_no
,
left_res
=
Hatch
.
query
.
filter
(
Hatch
.
hatch_no
==
hatch_no
,
Hatch
.
machine_no
==
machine_no
)
.
first
()
Hatch
.
machine_no
==
machine_no
)
.
first
()
left_res
.
left_count
=
left_res
.
left_count
-
1
if
left_res
.
left_count
<=
0
:
# 当数量等于1时,将柜子物品状态改为已售空
if
left_res
.
left_count
==
0
:
left_res
.
status
=
2
left_res
.
status
=
2
# 执行语句
# 执行语句
db
.
session
.
add
(
left_res
)
db
.
session
.
add
(
left_res
)
...
...
myapps/sukang24h/api/rent_portal.py
View file @
803caef7
...
@@ -189,7 +189,6 @@ def wx_pay_callback():
...
@@ -189,7 +189,6 @@ def wx_pay_callback():
rent_detail
.
content
=
i
.
content
rent_detail
.
content
=
i
.
content
rent_detail
.
summary
=
i
.
summary
rent_detail
.
summary
=
i
.
summary
db
.
session
.
add
(
rent_detail
)
db
.
session
.
add
(
rent_detail
)
db
.
session
.
add
(
i
)
total_fee
+=
rent_detail
.
price
total_fee
+=
rent_detail
.
price
if
total_fee
!=
int
(
callback_data
[
'total_fee'
]):
if
total_fee
!=
int
(
callback_data
[
'total_fee'
]):
...
...
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