Commit dafe918e by 魏强

update;

parent c1282bdb
...@@ -353,7 +353,7 @@ def force_refund(): ...@@ -353,7 +353,7 @@ def force_refund():
logger.info('comment') logger.info('comment')
logger.info(comment) logger.info(comment)
if not refund_type or not rent_no or not comment: if not refund_type or not rent_no:
return jsonify(PARAMETER_ERROR) return jsonify(PARAMETER_ERROR)
rent_info = db.session.query(Production, Rent).join(Rent, Rent.id == Production.rent_id).filter( rent_info = db.session.query(Production, Rent).join(Rent, Rent.id == Production.rent_id).filter(
...@@ -371,17 +371,33 @@ def force_refund(): ...@@ -371,17 +371,33 @@ def force_refund():
elif refund_type == '3': elif refund_type == '3':
# 按时间扣款 # 按时间扣款
back_time = json_data.get('back_time', None) back_time = json_data.get('back_time', None)
logger.info('back time')
logger.info(back_time)
if not comment or not back_time:
return jsonify(PARAMETER_ERROR)
money = RentService.check_fee_liuyuan(rent_info.Rent.pay_time.strftime('%Y-%m-%d %H:%M:%S'), money = RentService.check_fee_liuyuan(rent_info.Rent.pay_time.strftime('%Y-%m-%d %H:%M:%S'),
back_time.strftime('%Y-%m-%d %H:%M:%S'), back_time.strftime('%Y-%m-%d %H:%M:%S'),
rent_info.Rent.one_day_price, rent_info.Rent.free_time) rent_info.Rent.one_day_price, rent_info.Rent.free_time)
elif refund_type == '4': elif refund_type == '4':
# 退10元 # 退10元
if not comment:
return jsonify(PARAMETER_ERROR)
money = 1000 money = 1000
elif refund_type == '5': elif refund_type == '5':
# 退15元 # 退15元
if not comment:
return jsonify(PARAMETER_ERROR)
money = 1500 money = 1500
elif refund_type == '6': elif refund_type == '6':
# 退25元 # 退25元
if not comment:
return jsonify(PARAMETER_ERROR)
money = 2500 money = 2500
else: else:
return jsonify({'code': -1, 'msg': 'refund type error!'}) return jsonify({'code': -1, 'msg': 'refund type error!'})
......
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