Commit 8e09f0a0 by Aeolus

update

parent 5a4f9857
...@@ -254,6 +254,8 @@ def wx_pay_callback(): ...@@ -254,6 +254,8 @@ def wx_pay_callback():
prepay_id = redis_client.get(USER_RENT_PREPAY_ID + str(user_id) + rent_no) prepay_id = redis_client.get(USER_RENT_PREPAY_ID + str(user_id) + rent_no)
if prepay_id: if prepay_id:
rent.prepay_id = prepay_id rent.prepay_id = prepay_id
db.session.add(rent)
db.session.commit()
total_fee = 0 total_fee = 0
...@@ -283,12 +285,16 @@ def wx_pay_callback(): ...@@ -283,12 +285,16 @@ def wx_pay_callback():
rent_detail.summary = i.summary rent_detail.summary = i.summary
db.session.add(rent_detail) db.session.add(rent_detail)
total_fee += rent_detail.total total_fee += rent_detail.total
i.left_count -= 1
if i.left_count <= 0:
i.status = 2
db.session.add(i)
db.session.commit()
if total_fee != int(callback_data['total_fee']): if total_fee != int(callback_data['total_fee']):
return xmltodict.unparse({'xml': error_data}, pretty=True), header return xmltodict.unparse({'xml': error_data}, pretty=True), header
db.session.add(rent)
db.session.commit()
except Exception as e: except Exception as e:
logger.info(e) logger.info(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