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
c30d5082
Commit
c30d5082
authored
Nov 03, 2021
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
6c9ffb86
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
config/wechat_config.py
+1
-1
models/models.py
+1
-0
myapps/sukang24h/api/nfc_card_portal.py
+29
-2
No files found.
config/wechat_config.py
View file @
c30d5082
...
...
@@ -44,4 +44,4 @@ platform_appid_config_dict = {
}
NFC_PAY_CALLBCK_URL
=
"'/nfc_card/wx_pay_callback'"
NFC_PAY_CALLBCK_URL
=
'/nfc_card/wx_pay_callback'
models/models.py
View file @
c30d5082
...
...
@@ -109,6 +109,7 @@ class NfcCardPayRecord(Base):
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
)
card_no
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
),
index
=
True
,
comment
=
'卡片编号'
)
rent_no
=
Column
(
VARCHAR
(
40
),
nullable
=
False
,
comment
=
'租借单号'
)
user_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
index
=
True
,
comment
=
'用户id'
)
is_pay
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
),
comment
=
'是否支付'
)
pay_money
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'充值金额'
)
prepay_id
=
Column
(
VARCHAR
(
191
),
comment
=
'微信支付prepay_id'
)
...
...
myapps/sukang24h/api/nfc_card_portal.py
View file @
c30d5082
...
...
@@ -13,7 +13,7 @@ import time
from
flask
import
Blueprint
,
request
,
jsonify
,
g
from
config.commen_config
import
USER_RENT_PREPAY_ID
from
config.wechat_config
import
platform_appid_config_list
,
pay_config_list
from
config.wechat_config
import
platform_appid_config_list
,
pay_config_list
,
NFC_PAY_CALLBCK_URL
from
models.base_model
import
db
from
models.models
import
NfcCard
,
NfcCardPayRecord
from
service.rent_service
import
RentService
...
...
@@ -80,7 +80,7 @@ def run_nfc_card_activate():
}
# 微信下单接口
pay_info
=
wechat_service
.
unifiedorder
(
pay_data
,
callback_url
=
)
pay_info
=
wechat_service
.
unifiedorder
(
pay_data
,
callback_url
=
NFC_PAY_CALLBCK_URL
)
if
not
pay_info
:
return
BaseResponse
(
**
WE_MINIAPP_PAY_FAIL
)
...
...
@@ -146,3 +146,30 @@ def run_nfc_card_wx_pay_callback():
return
xmltodict
.
unparse
({
'xml'
:
error_data
},
pretty
=
True
),
header
return
xmltodict
.
unparse
({
'xml'
:
response_data
},
pretty
=
True
),
header
@nfc_card_route.route
(
'/pay_record'
,
methods
=
[
'POST'
])
def
run_nfc_card_pay_record
():
json_data
=
request
.
get_json
()
page
=
json_data
[
"page"
]
page_size
=
json_data
[
"pageSize"
]
pay_month
=
json_data
[
"pay_month"
]
filter_list
=
[
NfcCardPayRecord
.
user_id
==
g
.
user
.
id
]
order_list
=
[
NfcCardPayRecord
.
created_at
.
desc
()]
rent_list
=
NfcCardPayRecord
.
query
.
filter
(
*
filter_list
)
.
order_by
(
*
order_list
)
.
offset
((
page
-
1
)
*
page_size
)
.
limit
(
page_size
)
.
all
()
return_data
=
[]
for
rent
in
rent_list
:
tmp_data
=
{}
tmp_data
[
"rent_no"
]
=
rent
.
rent_no
tmp_data
[
"card_no"
]
=
rent
.
card_no
tmp_data
[
"user_id"
]
=
rent
.
user_id
tmp_data
[
"pay_money"
]
=
rent
.
pay_money
tmp_data
[
"pay_date"
]
=
rent
.
created_at
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
return_data
.
append
(
tmp_data
)
return
BaseResponse
(
data
=
return_data
)
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