Commit 96f9fb5f by Aeolus

update

parent 1314ae68
......@@ -74,7 +74,7 @@ def create_rent():
if len(hatch_list) < count:
return jsonify(HATCH_NOT_ALL_EXIST_ERROR)
hatch_no_list = [x.hatch_no for x in hatch_list[:count]]
open_hatchs.append(hatch_no_list)
open_hatchs += hatch_no_list
# 配置微信订单数据
wechat_service = WeChatPayService(app_id=platform_appid_config_list[user.platform],
......@@ -87,10 +87,8 @@ def create_rent():
'openid': user.openid,
'timeStamp': str(int(time.time())),
'attach': {
"productions": productions,
"machine_no": machine_no,
"user_id": user.id,
"machine_id": machine.id,
"platform": machine.mch_platform,
"open_hatchs": open_hatchs
}
......@@ -136,8 +134,6 @@ def wx_pay_callback():
rent_data = json.loads(attach)
platform = rent_data["platform"]
machine_no = rent_data["machine_no"]
machine_id = rent_data["machine_id"]
productions = rent_data["productions"]
open_hatchs = rent_data["open_hatchs"]
user_id = rent_data["user_id"]
platform = pay_config_list[platform]
......@@ -171,7 +167,7 @@ def wx_pay_callback():
rent = Rent()
rent.rent_no = rent_no
rent.machine_no = machine.machine_no
rent.user_id = rent_data["user_id"]
rent.user_id = user_id
rent.place_id = machine.place_id
rent.total = int(callback_data["total_fee"])
rent.add_time = datetime.datetime.now()
......@@ -179,7 +175,7 @@ def wx_pay_callback():
rent.pay_time = datetime.datetime.strptime(callback_data["time_end"], "%Y%m%d%H%M%S")
rent.rent_type = type
rent.mch_platform = platform
prepay_id = redis_client.get(USER_RENT_PREPAY_ID + str(rent_data["user_id"]) + rent_no)
prepay_id = redis_client.get(USER_RENT_PREPAY_ID + str(user_id) + rent_no)
if prepay_id:
rent.prepay_id = prepay_id
......
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