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
4cd24400
Commit
4cd24400
authored
Nov 09, 2021
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
8a4a7948
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
models/models.py
+1
-0
myapps/sukang24h/api/nfc_card_portal.py
+42
-0
No files found.
models/models.py
View file @
4cd24400
...
@@ -97,6 +97,7 @@ class NfcCard(Base):
...
@@ -97,6 +97,7 @@ class NfcCard(Base):
money
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
money
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
mch_platform
=
Column
(
INTEGER
(
11
),
nullable
=
False
,
server_default
=
text
(
"'1'"
),
comment
=
'1咻咻'
)
mch_platform
=
Column
(
INTEGER
(
11
),
nullable
=
False
,
server_default
=
text
(
"'1'"
),
comment
=
'1咻咻'
)
status
=
Column
(
TINYINT
(
4
),
nullable
=
False
,
comment
=
'状态0停用1正常'
)
status
=
Column
(
TINYINT
(
4
),
nullable
=
False
,
comment
=
'状态0停用1正常'
)
limit_count
=
Column
(
TINYINT
(
1
),
nullable
=
False
,
comment
=
'限制消费次数'
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
...
...
myapps/sukang24h/api/nfc_card_portal.py
View file @
4cd24400
...
@@ -54,6 +54,48 @@ def run_nfc_card_activate():
...
@@ -54,6 +54,48 @@ def run_nfc_card_activate():
return
BaseResponse
()
return
BaseResponse
()
@nfc_card_route.route
(
"edit"
,
methods
=
[
"POST"
])
def
run_nfc_card_edit
():
json_data
=
request
.
get_json
()
card_no
=
json_data
[
"card_no"
]
user_name
=
json_data
.
get
(
"user_name"
,
None
)
phone
=
json_data
.
get
(
"phone"
,
None
)
limit_count
=
json_data
.
get
(
"limit_count"
,
None
)
card
=
NfcCard
.
query
.
filter_by
(
card_no
=
card_no
,
status
=
1
)
.
first
()
if
not
card
:
return
jsonify
(
NFC_CARD_NOT_EXIST
)
if
user_name
:
card
.
nick_name
=
user_name
if
phone
:
card
.
phone
=
phone
if
limit_count
:
card
.
limit_count
=
limit_count
db
.
session
.
add
(
card
)
db
.
session
.
commit
()
return
BaseResponse
()
@nfc_card_route.route
(
"delete"
,
methods
=
[
"POST"
])
def
run_nfc_card_delete
():
json_data
=
request
.
get_json
()
card_no
=
json_data
[
"card_no"
]
card
=
NfcCard
.
query
.
filter_by
(
card_no
=
card_no
,
status
=
1
)
.
first
()
if
not
card
:
return
jsonify
(
NFC_CARD_NOT_EXIST
)
card
.
status
=
-
1
db
.
session
.
add
(
card
)
db
.
session
.
commit
()
return
BaseResponse
()
@nfc_card_route.route
(
"my_cards"
,
methods
=
[
"POST"
])
@nfc_card_route.route
(
"my_cards"
,
methods
=
[
"POST"
])
def
get_my_cards
():
def
get_my_cards
():
json_data
=
request
.
get_json
()
json_data
=
request
.
get_json
()
...
...
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