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
5e17dee8
Commit
5e17dee8
authored
Nov 23, 2021
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
圈存记录接口
parent
4144dafc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
myapps/sukang24h/api/nfc_card_portal.py
+34
-0
utils/middlewares.py
+0
-0
No files found.
myapps/sukang24h/api/nfc_card_portal.py
View file @
5e17dee8
...
@@ -394,3 +394,37 @@ def run_nfc_card_load_succeed():
...
@@ -394,3 +394,37 @@ def run_nfc_card_load_succeed():
"money"
:
card_result
.
money
"money"
:
card_result
.
money
}
}
return
BaseResponse
(
data
=
return_data
)
return
BaseResponse
(
data
=
return_data
)
# 查询充值记录
@nfc_card_route.route
(
'/user_load_record'
,
methods
=
[
'POST'
])
def
run_nfc_card_user_load_record
():
json_data
=
request
.
get_json
()
secret
=
json_data
[
"secret"
]
card_no
=
json_data
[
"card_no"
]
page
=
json_data
.
get
(
"page"
,
1
)
page_size
=
json_data
.
get
(
"page_size"
,
5
)
if
secret
!=
NFC_PAY_LOAD_SECRET
:
return
jsonify
(
NFC_PAY_LOAD_SECRET_ERROR
)
card_result
=
NfcCard
.
query
.
filter_by
(
card_no
=
card_no
,
status
=
1
)
.
first
()
if
not
card_result
:
return
jsonify
(
NFC_CARD_NOT_EXIST
)
total_count
=
NfcCardPayRecord
.
query
.
filter_by
(
card_no
=
card_no
,
status
=
2
)
.
count
()
if
not
total_count
:
return
BaseResponse
(
data
=
[],
total_count
=
0
,
page
=
page
,
page_size
=
page_size
)
pay_records
=
NfcCardPayRecord
.
query
.
filter_by
(
card_no
=
card_no
,
status
=
2
)
.
all
()
result_data
=
[]
for
record
in
pay_records
:
tmp_data
=
{
"card_no"
:
record
.
card_no
,
"record_no"
:
record
.
rent_no
,
"load_money"
:
record
.
pay_money
,
"load_time"
:
record
.
updated_at
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
),
}
result_data
.
append
(
tmp_data
)
return
BaseResponse
(
data
=
result_data
,
total
=
total_count
,
page
=
page
,
page_size
=
page_size
)
utils/middlewares.py
View file @
5e17dee8
This diff is collapsed.
Click to expand it.
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