Browse Source

增加排序

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

+ 1 - 1
jianye_report.py

@@ -200,6 +200,7 @@ class JianYeReport(object):
                 if str(id) == str(x[0]):
                     sub.extend(x[1:])
             result.append(sub)
+        result.sort(key=lambda obj: obj[2])
         return result
 
     def house_data(self, house_ids):
@@ -257,7 +258,6 @@ class JianYeReport(object):
                                                     table_1[26], table_1[27], table_1[28], table_1[29], table_1[30], table_1[31],
                                                     table_1[32], table_1[33], table_1[34], table_1[35]
                                                     )
-                    table_2.sort(key=lambda obj: obj[2])
                     rfu.create_excel_file(table_2, self.sheet_names_1, title, [self.head_1, self.head_1, self.head_1], file_path)
                 elif customer_type == 1:
                     # 项目