判断获取到数据
This commit is contained in:
parent
8eced162b9
commit
84b81fb98c
|
|
@ -42,8 +42,9 @@ func (ee *ExcelExporter) Export(sql, pk string) error {
|
|||
ee.file.Write(last)
|
||||
}
|
||||
|
||||
ee.last = last[getPkIndex(data.Title, pk)]
|
||||
|
||||
if len(last) > 0 {
|
||||
ee.last = last[getPkIndex(data.Title, pk)]
|
||||
}
|
||||
//ee.file.Close()
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,6 +66,11 @@ func (e *Excel) TaskExport(d export.DataFetcher, t config.Task, params map[strin
|
|||
|
||||
count, last := e.Last()
|
||||
fmt.Printf("已导出 %d 条数据\n", batch*i+count)
|
||||
|
||||
if count == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
if count < batch {
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue