Browse Source

Merge branch 'dev/v4.8.71.2_dx' of qmx/jy into hotfix/v4.8.71.2

duxin 1 year ago
parent
commit
3a2f57bd7b
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/jfw/modules/subscribepay/src/util/dataExportExcel.go

+ 7 - 1
src/jfw/modules/subscribepay/src/util/dataExportExcel.go

@@ -60,7 +60,13 @@ func GetDataExportFileDataLen(path string) (int, error) {
 	if len(sheet1.Rows) == 0 {
 		return -1, fmt.Errorf("sheet1 hasn't Rows data ")
 	}
-	return sheet1.Rows[len(sheet1.Rows)-1].Cells[0].Int()
+	//避免最后一行为合并单元格数据
+	for l := len(sheet1.Rows) - 1; l > 0; l-- {
+		if sheet1.Rows[l].Cells[0].Value != "" {
+			return sheet1.Rows[l].Cells[0].Int()
+		}
+	}
+	return -1, fmt.Errorf("sheet1 get error")
 }
 
 // 生成数据导出excel