Commit 7cf36b48 by Aeolus

圈存接口修改

parent 614d3526
...@@ -372,6 +372,7 @@ def run_nfc_card_load_succeed(): ...@@ -372,6 +372,7 @@ def run_nfc_card_load_succeed():
secret = json_data["secret"] secret = json_data["secret"]
record_nos = json_data["record_nos"] record_nos = json_data["record_nos"]
card_no = json_data["card_no"] card_no = json_data["card_no"]
money = int(json_data["money"])
if secret != NFC_PAY_LOAD_SECRET: if secret != NFC_PAY_LOAD_SECRET:
return jsonify(NFC_PAY_LOAD_SECRET_ERROR) return jsonify(NFC_PAY_LOAD_SECRET_ERROR)
...@@ -382,10 +383,11 @@ def run_nfc_card_load_succeed(): ...@@ -382,10 +383,11 @@ def run_nfc_card_load_succeed():
for record_no in record_nos: for record_no in record_nos:
card_record = NfcCardPayRecord.query.filter_by(rent_no=record_no, status=1).first() # 查询到充值记录 card_record = NfcCardPayRecord.query.filter_by(rent_no=record_no, status=1).first() # 查询到充值记录
if card_record: if card_record:
card_result.money += card_record.pay_money
card_record.status = 2 card_record.status = 2
db.session.add(card_record) db.session.add(card_record)
card_result.money = money
try: try:
db.session.add(card_result) db.session.add(card_result)
db.session.commit() db.session.commit()
except SQLAlchemyError as e: except SQLAlchemyError as e:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment