Commit 66ab33b3 by Aeolus

update

parent 8e09f0a0
...@@ -254,8 +254,7 @@ def wx_pay_callback(): ...@@ -254,8 +254,7 @@ 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
...@@ -284,13 +283,15 @@ def wx_pay_callback(): ...@@ -284,13 +283,15 @@ def wx_pay_callback():
rent_detail.content = i.content rent_detail.content = i.content
rent_detail.summary = i.summary rent_detail.summary = i.summary
db.session.add(rent_detail) db.session.add(rent_detail)
db.session.add(rent)
db.session.commit()
total_fee += rent_detail.total total_fee += rent_detail.total
i.left_count -= 1 i.left_count -= 1
if i.left_count <= 0: if i.left_count <= 0:
i.status = 2 i.status = 2
db.session.add(i) db.session.add(i)
db.session.commit() 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
......
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