Commit 80aa9f2c by Aeolus

圈存接口修改

parent 935cd900
......@@ -379,14 +379,18 @@ def run_nfc_card_load_succeed():
if not card_result:
return jsonify(NFC_CARD_NOT_EXIST)
for record_no in record_nos:
card_record = NfcCardPayRecord.query.filter_by(rent_no=record_no).first() # 查询到充值记录
card_result.money += card_record.pay_money
card_record.status = 2
db.session.add(card_record)
card_record = NfcCardPayRecord.query.filter_by(rent_no=record_no, status=1).first() # 查询到充值记录
if card_record:
card_result.money += card_record.pay_money
card_record.status = 2
db.session.add(card_record)
try:
db.session.add(card_result)
db.session.commit()
except SQLAlchemyError as e:
db.session.rollback()
return BaseResponse()
return_data = {
"card_no": card_result.card_no,
"money": card_result.money
}
return BaseResponse(data=return_data)
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