Commit 93523e8d by Aeolus

价格为0无法计算最大可租借天数bug修复

parent 4c7af5f5
......@@ -59,3 +59,12 @@ docs/_build/
# PyBuilder
target/
# Cert
*.pem
*.pfx
*.key
*.crt
*.cer
*.truststore
\ No newline at end of file
......@@ -9,7 +9,7 @@ from sqlalchemy.exc import SQLAlchemyError
from Config.base_config import ACTION_PWD
from Libs.ErrorTips import BASE_RESPONSE, REFUND_NOT_RENT_INFO, REFUND_BACK_TIME_ERROR, REFUND_NOT_PRODUCTION_INFO, \
REFUND_MONEY_IS_ZERO, ACTION_CODE_ERROR, PARAMETER_ERROR
REFUND_MONEY_IS_ZERO, ACTION_CODE_ERROR, PARAMETER_ERROR, MACHINE_NOT_EXIST_ERROR
from Libs.Helper import Helper
from Libs.Logger import logger
from Model.Base import db
......@@ -729,7 +729,10 @@ def get_machine_price():
if machine.price_type == 1:
# 免费时间
data["time_price"].append([str(0) + '天', 0])
max_days = machine.deposit // machine.one_day_price + 1
if machine.one_day_price > 0:
max_days = machine.deposit // machine.one_day_price + 1
else:
max_days = 5
i = 1
while i < max_days:
data["time_price"].append([str(i) + '天', machine.one_day_price * i])
......
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