Browse Source

ssss

Signed-off-by: Binren Zhnag <zhangbr@elab-plus.com>
Binren Zhnag 4 years ago
parent
commit
d998365850
1 changed files with 4 additions and 4 deletions
  1. 4 4
      jianye_report.py

+ 4 - 4
jianye_report.py

@@ -112,7 +112,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:
+            if str(x[0]) == str(brand_id) and x[1] is not None and len(x[x]) > 4:
                 result.append(x[1])
         return result
 
@@ -201,7 +201,7 @@ class JianYeReport(object):
                 if str(id) == str(x[0]):
                     sub.extend(x[1:])
             result.append(sub)
-        # result.sort(key=lambda obj: obj[2], reverse=True)
+        result.sort(key=lambda obj: obj[2], reverse=True)
         return result
 
     def house_data(self, house_ids):
@@ -247,7 +247,7 @@ class JianYeReport(object):
                 region_name = customer[4]
                 title = self.get_mail_title(customer_type, region_name, name)
                 content = self.get_mail_content(customer_type)
-                file_path = save_path + '/' + title + '.xlsx'
+                file_path = save_path + '/' + title + '.xls'
                 try:
 
                     if customer_type == 2:
@@ -301,7 +301,7 @@ class JianYeReport(object):
                 try:
                     rfu.create_excel_file(data[0], data[1], data[2], data[3], data[4])
                     # [title, content, mail, file_path, title + '.xlsx', name]
-                    send_mail_info.append([data[2], data[5], data[7], data[4], data[2] + '.xlsx', data[6]])
+                    send_mail_info.append([data[2], data[5], data[7], data[4], data[2] + '.xls', data[6]])
                 except Exception as e:
                     print(e)
                     send_mail_log.append([data[6], data[7], data[2], -1, '文件创建失败'])