Commit 935cd900 by Aeolus

圈存接口

parent a7d0e3c8
...@@ -361,12 +361,12 @@ def run_nfc_card_user_pay_record(): ...@@ -361,12 +361,12 @@ def run_nfc_card_user_pay_record():
} }
result_data.append(tmp_data) result_data.append(tmp_data)
return BaseResponse(data=result_data, total=0, page=page, page_size=page_size) return BaseResponse(data=result_data, total=total_count, page=page, page_size=page_size)
# 充值成功后改变数据库 # 充值成功后改变数据库
@nfc_card_route.route('/user_pay_succeed', methods=['POST']) @nfc_card_route.route('/load_succeed', methods=['POST'])
def run_nfc_card_pay_succeed(): def run_nfc_card_load_succeed():
json_data = request.get_json() json_data = request.get_json()
secret = json_data["secret"] secret = json_data["secret"]
record_nos = json_data["record_nos"] record_nos = json_data["record_nos"]
...@@ -377,7 +377,7 @@ def run_nfc_card_pay_succeed(): ...@@ -377,7 +377,7 @@ def run_nfc_card_pay_succeed():
card_result = NfcCard.query.filter_by(card_no=card_no).first() # 查询到卡号 card_result = NfcCard.query.filter_by(card_no=card_no).first() # 查询到卡号
if not card_result: if not card_result:
return jsonify(NO_NFC_CARD_ERROR) return jsonify(NFC_CARD_NOT_EXIST)
for record_no in record_nos: for record_no in record_nos:
card_record = NfcCardPayRecord.query.filter_by(rent_no=record_no).first() # 查询到充值记录 card_record = NfcCardPayRecord.query.filter_by(rent_no=record_no).first() # 查询到充值记录
card_result.money += card_record.pay_money card_result.money += card_record.pay_money
......
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