|
@@ -110,7 +110,7 @@ class JianYeReport(object):
|
|
|
def get_house_id_by_brand_id(self, brand_id):
|
|
|
result = []
|
|
|
for x in self.get_city_house_id():
|
|
|
- if str(x[0]) == brand_id:
|
|
|
+ if str(x[0]) == str(brand_id):
|
|
|
result.append(x[1])
|
|
|
return result
|
|
|
|
|
@@ -121,7 +121,7 @@ class JianYeReport(object):
|
|
|
data_2 = []
|
|
|
number_2 = 0
|
|
|
for x in self.get_recommend_data(time_range):
|
|
|
- if str(x[0]) == self.brand_id:
|
|
|
+ if str(x[0]) == str(self.brand_id):
|
|
|
number_2 = x[1]
|
|
|
data_2.append(number_2)
|
|
|
data_3 = []
|
|
@@ -130,7 +130,7 @@ class JianYeReport(object):
|
|
|
type_value = self.index_type.get(key)
|
|
|
number = 0
|
|
|
for x in self.db.select(Sql.sql_10, [time_range[0], time_range[1]]):
|
|
|
- if x[0] == type_value:
|
|
|
+ if str(x[0]) == str(type_value):
|
|
|
number = x[1]
|
|
|
data_3.append(number)
|
|
|
result.extend(data_1)
|
|
@@ -165,7 +165,7 @@ class JianYeReport(object):
|
|
|
sub = [id]
|
|
|
number = 0
|
|
|
for x in self.get_recommend_data(time_range):
|
|
|
- if id == x[0]:
|
|
|
+ if str(id) == str(x[0]):
|
|
|
number = x[1]
|
|
|
sub.append(number)
|
|
|
data_2.append(sub)
|
|
@@ -174,14 +174,14 @@ class JianYeReport(object):
|
|
|
sub = []
|
|
|
for x in self.house_data_detail(time_range):
|
|
|
# house_id, type, COUNT(DISTINCT customer_mobile)
|
|
|
- if house_id == x[0]:
|
|
|
+ if str(house_id) == str(x[0]):
|
|
|
sub.append(x)
|
|
|
house_data = []
|
|
|
for key in self.index_type.keys():
|
|
|
value = self.index_type.get(key)
|
|
|
number = 0
|
|
|
for x in sub:
|
|
|
- if value == x[1]:
|
|
|
+ if str(value) == str(x[1]):
|
|
|
number = x[2]
|
|
|
house_data.append(number)
|
|
|
data_3.append(house_data)
|
|
@@ -189,27 +189,27 @@ class JianYeReport(object):
|
|
|
for id in house_ids:
|
|
|
sub = []
|
|
|
for x in city_info:
|
|
|
- if id == x[1]:
|
|
|
- sub.extend([x[4], x[3]])
|
|
|
+ if str(id) == str(x[1]):
|
|
|
+ sub.extend([x[3], x[2]])
|
|
|
for x in data_1:
|
|
|
- if id == x[0]:
|
|
|
+ if str(id) == str(x[0]):
|
|
|
sub.extend(x[1:])
|
|
|
for x in data_2:
|
|
|
- if id == x[0]:
|
|
|
+ if str(id) == str(x[0]):
|
|
|
sub.extend(x[1:])
|
|
|
for x in data_3:
|
|
|
- if id == x[0]:
|
|
|
+ if str(id) == str(x[0]):
|
|
|
sub.extend(x[1:])
|
|
|
result.append(sub)
|
|
|
return result
|
|
|
|
|
|
def house_data(self, house_ids):
|
|
|
- time_rang_1 = rpfu.get_prd_day()
|
|
|
- time_rang_2 = rpfu.get_time_range_month()
|
|
|
+ time_range_1 = rpfu.get_prd_day()
|
|
|
+ time_range_2 = rpfu.get_time_range_month()
|
|
|
time_range_3 = rpfu.get_all_time_data_range()
|
|
|
result = []
|
|
|
- result.append(self.house_data_of_time(time_rang_1, house_ids))
|
|
|
- result.append(self.house_data_of_time(time_rang_2, house_ids))
|
|
|
+ result.append(self.house_data_of_time(time_range_1, house_ids))
|
|
|
+ result.append(self.house_data_of_time(time_range_2, house_ids))
|
|
|
result.append(self.house_data_of_time(time_range_3, house_ids))
|
|
|
return result
|
|
|
|
|
@@ -302,12 +302,11 @@ class JianYeReport(object):
|
|
|
return message
|
|
|
|
|
|
def get_house_ids(self, ids_str):
|
|
|
- if str(ids_str).find(',') != -1:
|
|
|
- pass
|
|
|
- return [x for x in str(ids_str).split(',')]
|
|
|
- else:
|
|
|
+ if str(ids_str).find(',') == -1:
|
|
|
return [ids_str]
|
|
|
+ else:
|
|
|
+ return [x for x in str(ids_str).split(',')]
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
- pass
|
|
|
+ pass
|