|  | @@ -27,7 +27,7 @@ class JianYeReport(object):
 | 
	
		
			
				|  |  |      ]
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      head_1 = ['区域', '城市', '项目名称', '浏览量', '浏览人数', '新增用户', '新增获电', '推荐用户', '分享获电', '裂变获电',
 | 
	
		
			
				|  |  | -              '扫码到访数', '全民经纪人注册数', '老业主注册数', '报备成功数', '报备到访数']
 | 
	
		
			
				|  |  | +              '扫码到访数', '全民经纪人注册数', '老业主注册数', '报备成功数', '报备到访数', '可分派客户数', '已分派客户数']
 | 
	
		
			
				|  |  |      brand_id = '13'
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      head_2 = ['区域名称', '城市', '项目名称', '推荐人姓名', '推荐人手机号', '组织', '分享获电', '经纪人注册数', '报备成功数']
 | 
	
	
		
			
				|  | @@ -164,6 +164,10 @@ class JianYeReport(object):
 | 
	
		
			
				|  |  |                      return x[3:]
 | 
	
		
			
				|  |  |          return [0, 0, 0, 0]
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    def get_dispatchable_mobile_qutty_brand(self, time_range):
 | 
	
		
			
				|  |  | +        data = self.db.select(Sql.sql_20, [time_range[0], time_range[1]])
 | 
	
		
			
				|  |  | +        return [data[0][2], data[0][3]]
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      def brand_data_of_time(self, time_range, time_type):
 | 
	
		
			
				|  |  |          result = []
 | 
	
		
			
				|  |  |          data_1 = self.brand_pv_by_time_type(time_type)
 | 
	
	
		
			
				|  | @@ -181,9 +185,15 @@ class JianYeReport(object):
 | 
	
		
			
				|  |  |                  if str(x[0]) == str(key):
 | 
	
		
			
				|  |  |                      number = x[1]
 | 
	
		
			
				|  |  |              data_3.append(number)
 | 
	
		
			
				|  |  | +        data_4 = self.get_dispatchable_mobile_qutty_brand(time_range)
 | 
	
		
			
				|  |  | +        # 4
 | 
	
		
			
				|  |  |          result.extend(data_1)
 | 
	
		
			
				|  |  | +        # 1
 | 
	
		
			
				|  |  |          result.extend(data_2)
 | 
	
		
			
				|  |  | +        # 7
 | 
	
		
			
				|  |  |          result.extend(data_3)
 | 
	
		
			
				|  |  | +        # 2
 | 
	
		
			
				|  |  | +        result.extend(data_4)
 | 
	
		
			
				|  |  |          return result
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      def brand_data(self):
 | 
	
	
		
			
				|  | @@ -205,6 +215,10 @@ class JianYeReport(object):
 | 
	
		
			
				|  |  |                      return x[3:]
 | 
	
		
			
				|  |  |          return [0, 0, 0, 0]
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    def get_dispatchable_mobile_qutty_house(self, time_range, house_ids):
 | 
	
		
			
				|  |  | +        data = self.db.select(Sql.sql_19, [time_range[0], time_range[1], house_ids])
 | 
	
		
			
				|  |  | +        return data
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      def house_data_of_time(self, time_range, house_ids, time_type):
 | 
	
		
			
				|  |  |          # brand_id, house_id, house_name, city
 | 
	
		
			
				|  |  |          city_info = self.get_city_house_id()
 | 
	
	
		
			
				|  | @@ -214,18 +228,20 @@ class JianYeReport(object):
 | 
	
		
			
				|  |  |              sub.extend(self.get_house_pv_data(id, time_type))
 | 
	
		
			
				|  |  |              data_1.append(sub)
 | 
	
		
			
				|  |  |          data_2 = []
 | 
	
		
			
				|  |  | +        recommend_data = self.get_recommend_data(time_range)
 | 
	
		
			
				|  |  |          for id in house_ids:
 | 
	
		
			
				|  |  |              sub = [id]
 | 
	
		
			
				|  |  |              number = 0
 | 
	
		
			
				|  |  | -            for x in self.get_recommend_data(time_range):
 | 
	
		
			
				|  |  | +            for x in recommend_data:
 | 
	
		
			
				|  |  |                  if str(id) == str(x[0]):
 | 
	
		
			
				|  |  |                      number = x[1]
 | 
	
		
			
				|  |  |              sub.append(number)
 | 
	
		
			
				|  |  |              data_2.append(sub)
 | 
	
		
			
				|  |  |          data_3 = []
 | 
	
		
			
				|  |  | +        house_data_detail = self.house_data_detail(time_range)
 | 
	
		
			
				|  |  |          for house_id in house_ids:
 | 
	
		
			
				|  |  |              sub = []
 | 
	
		
			
				|  |  | -            for x in self.house_data_detail(time_range):
 | 
	
		
			
				|  |  | +            for x in house_data_detail:
 | 
	
		
			
				|  |  |                  # house_id, type, COUNT(DISTINCT customer_mobile)
 | 
	
		
			
				|  |  |                  if str(house_id) == str(x[0]):
 | 
	
		
			
				|  |  |                      sub.append(x)
 | 
	
	
		
			
				|  | @@ -237,6 +253,8 @@ class JianYeReport(object):
 | 
	
		
			
				|  |  |                          number = x[2]
 | 
	
		
			
				|  |  |                  house_data.append(number)
 | 
	
		
			
				|  |  |              data_3.append(house_data)
 | 
	
		
			
				|  |  | +        data_4 = []
 | 
	
		
			
				|  |  | +        dispatchabl_data = self.get_dispatchable_mobile_qutty_house(time_range, house_ids)
 | 
	
		
			
				|  |  |          result = []
 | 
	
		
			
				|  |  |          brand_data = []
 | 
	
		
			
				|  |  |          for id in house_ids:
 | 
	
	
		
			
				|  | @@ -384,18 +402,25 @@ class JianYeReport(object):
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          content = content.format(rpfu.get_month_day(),
 | 
	
		
			
				|  |  |                                   brand_table_one[0], brand_table_one[1], brand_table_one[2], brand_table_one[3],
 | 
	
		
			
				|  |  | -                                 brand_table_one[4], brand_table_one[5],
 | 
	
		
			
				|  |  | +                                 brand_table_one[4],
 | 
	
		
			
				|  |  | +                                 brand_table_one[5],
 | 
	
		
			
				|  |  |                                   brand_table_one[6], brand_table_one[8], brand_table_one[10], brand_table_one[11],
 | 
	
		
			
				|  |  | +                                 brand_table_one[12], brand_table_one[13],
 | 
	
		
			
				|  |  |                                   rpfu.get_month(),
 | 
	
		
			
				|  |  | -                                 brand_table_one[12], brand_table_one[13], brand_table_one[14], brand_table_one[15],
 | 
	
		
			
				|  |  | -                                 brand_table_one[16],
 | 
	
		
			
				|  |  | -                                 brand_table_one[17],
 | 
	
		
			
				|  |  | -                                 brand_table_one[18], brand_table_one[20], brand_table_one[22], brand_table_one[23],
 | 
	
		
			
				|  |  | -                                 brand_table_one[24], brand_table_one[25], brand_table_one[26], brand_table_one[27],
 | 
	
		
			
				|  |  | -                                 brand_table_one[28],
 | 
	
		
			
				|  |  | -                                 brand_table_one[29],
 | 
	
		
			
				|  |  | -                                 brand_table_one[30], brand_table_one[32], brand_table_one[34], brand_table_one[35]
 | 
	
		
			
				|  |  | -                                 )
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                                 brand_table_one[14], brand_table_one[15], brand_table_one[16], brand_table_one[17],
 | 
	
		
			
				|  |  | +                                 brand_table_one[18],
 | 
	
		
			
				|  |  | +                                 brand_table_one[19],
 | 
	
		
			
				|  |  | +                                 brand_table_one[20], brand_table_one[22], brand_table_one[24], brand_table_one[25],
 | 
	
		
			
				|  |  | +                                 brand_table_one[26], brand_table_one[27],
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                                 brand_table_one[28], brand_table_one[29], brand_table_one[30], brand_table_one[31],
 | 
	
		
			
				|  |  | +                                 brand_table_one[32],
 | 
	
		
			
				|  |  | +                                 brand_table_one[33],
 | 
	
		
			
				|  |  | +                                 brand_table_one[34], brand_table_one[36], brand_table_one[38], brand_table_one[39],
 | 
	
		
			
				|  |  | +                                 brand_table_one[40], brand_table_one[41],
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        )
 | 
	
		
			
				|  |  |          return content
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      def get_customer_info_by_id(self, customer_id):
 |