Forráskód Böngészése

集团层面增加品牌层

Signed-off-by: binren <zhangbr@elab-plus.com>
binren 4 éve
szülő
commit
fa53baf489
2 módosított fájl, 15 hozzáadás és 12 törlés
  1. 14 11
      jianye_report.py
  2. 1 1
      sql.py

+ 14 - 11
jianye_report.py

@@ -141,7 +141,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]) == str(brand_id) and x[1] is not None and len(x[1]) > 4:
+            if str(x[0]) == str(brand_id):
                 result.append(x[1])
         return result
 
@@ -239,16 +239,19 @@ class JianYeReport(object):
         result = []
         for id in house_ids:
             sub = []
-            for x in self.house_region:
-                if str(x[1]) == str(id):
-                    sub.append(x[3])
-            if len(sub) == 0:
-                sub.append(' ')
-            for x in city_info:
-                if str(id) == str(x[1]):
-                    sub.extend([x[3], x[2]])
-            if len(sub) == 0:
-                sub.extend(['0000', '0000'])
+            if id == '0':
+                sub.append(['品牌层', '品牌层', '品牌层'])
+            else:
+                for x in self.house_region:
+                    if str(x[1]) == str(id):
+                        sub.append(x[3])
+                if len(sub) == 0:
+                    sub.append(' ')
+                for x in city_info:
+                    if str(id) == str(x[1]):
+                        sub.extend([x[3], x[2]])
+                if len(sub) == 0:
+                    sub.extend(['0000', '0000'])
             for x in data_1:
                 if str(id) == str(x[0]):
                     sub.extend(x[1:])

+ 1 - 1
sql.py

@@ -3,7 +3,7 @@
 class Sql:
     # 获取项目的城市信息
     sql_1 = """
-        select IFNULL(brand_id, -1), house_id, house_name, city from d_house a
+        select IFNULL(brand_id, -1), house_id, house_name, city from d_house a where brand_id = '13' order by house_id
     """
 
     # 根据任务id获取推送客户信息