|
@@ -44,12 +44,12 @@ func main() {
|
|
|
}
|
|
|
|
|
|
func loopMaxId(maxId int) int {
|
|
|
- list, err := db.New("t_news").Attr("id,content,url").
|
|
|
- Where("status", "Brief").WhereF("id > ?", 4000).Order("ORDER BY id asc").Limit(0, 100).GetAll()
|
|
|
+ list, err := db.New("t_news").Attr("id,content,url").WhereF("id > ?", maxId).Order("ORDER BY id asc").Limit(0, 100).GetAll()
|
|
|
fmt.Println("loopLen", len(list), err)
|
|
|
for _, record := range list {
|
|
|
update := map[string]interface{}{}
|
|
|
id := record["id"].(int64)
|
|
|
+ idInt := int(id)
|
|
|
content := record["content"].(string)
|
|
|
url := record["url"].(string)
|
|
|
brief := ""
|
|
@@ -69,6 +69,10 @@ func loopMaxId(maxId int) int {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ // maxId更新
|
|
|
+ if maxId < idInt {
|
|
|
+ maxId = idInt
|
|
|
+ }
|
|
|
//
|
|
|
if brief == "" {
|
|
|
update["status"] = "Delete"
|