修改罗干平米租金算法
This commit is contained in:
@@ -11,15 +11,8 @@ import fangjia
|
|||||||
#import pytz
|
#import pytz
|
||||||
|
|
||||||
def input_time(day):
|
def input_time(day):
|
||||||
#from dateutil.parser import parse
|
|
||||||
#today=parse(str(ti))
|
|
||||||
|
|
||||||
today=datetime.datetime.now()
|
today=datetime.datetime.now()
|
||||||
|
|
||||||
#first = datetime.date(day=1, month=today.month, year=today.year)
|
|
||||||
|
|
||||||
lastMonth = today - datetime.timedelta(days=day)
|
lastMonth = today - datetime.timedelta(days=day)
|
||||||
|
|
||||||
def plus(k):
|
def plus(k):
|
||||||
if k<10:
|
if k<10:
|
||||||
return '0'+str(k)
|
return '0'+str(k)
|
||||||
@@ -27,13 +20,9 @@ def input_time(day):
|
|||||||
return str(k)
|
return str(k)
|
||||||
y=lastMonth.year
|
y=lastMonth.year
|
||||||
m=lastMonth.month
|
m=lastMonth.month
|
||||||
#d=lastMonth.day
|
|
||||||
day=calendar.monthrange(y,m)[1]
|
day=calendar.monthrange(y,m)[1]
|
||||||
|
|
||||||
cc=str(y)+plus(m)+plus(day)
|
cc=str(y)+plus(m)+plus(day)
|
||||||
#bb=parse(cc)
|
|
||||||
#pacific = pytz.timezone('Asia/Shanghai')
|
|
||||||
#return pacific.localize(bb)
|
|
||||||
return int(cc)
|
return int(cc)
|
||||||
|
|
||||||
|
|
||||||
@@ -53,8 +42,8 @@ logger = fangjia.get_logger("RentCalcCmdSender")
|
|||||||
|
|
||||||
|
|
||||||
def get_district(city):
|
def get_district(city):
|
||||||
timm=input_time(0)
|
timm=input_time(30)
|
||||||
timd=input_time(360)
|
timd=input_time(390)
|
||||||
seaweeds = []
|
seaweeds = []
|
||||||
keys = {"city": 1, "region": 1, "name": 1, "_id": 0}
|
keys = {"city": 1, "region": 1, "name": 1, "_id": 0}
|
||||||
for dis in fangjia.get_collection("fangjia", "seaweed", config.get_seaweed_host()).find({"cat": "district", "status": 0, "city": city}, keys):
|
for dis in fangjia.get_collection("fangjia", "seaweed", config.get_seaweed_host()).find({"cat": "district", "status": 0, "city": city}, keys):
|
||||||
|
|||||||
Reference in New Issue
Block a user