|
@@ -39,9 +39,9 @@ func main() {
|
|
|
}
|
|
|
|
|
|
func loopMaxId(maxId int) int {
|
|
|
- // var list []model.TNew
|
|
|
- list, _ := db.New("t_news").Attr("id,content,url").
|
|
|
- Where("status=?", "Pending").Where("id>?", 4000).Order("ORDER BY id asc").Limit(0, 100).GetAll()
|
|
|
+ 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()
|
|
|
+ fmt.Println("loopLen", len(list), err)
|
|
|
for _, record := range list {
|
|
|
update := map[string]interface{}{}
|
|
|
id := record["content"].(int)
|
|
@@ -66,9 +66,9 @@ func loopMaxId(maxId int) int {
|
|
|
}
|
|
|
//
|
|
|
if brief == "" {
|
|
|
- update["status"] = "Deactivated"
|
|
|
+ update["status"] = "Delete"
|
|
|
} else {
|
|
|
- update["status"] = "Activated"
|
|
|
+ update["status"] = "Picture"
|
|
|
}
|
|
|
fmt.Println("finish", id, brief)
|
|
|
if _, err := db.Pool().Update("t_news", update, map[string]interface{}{"id": id}); err != nil {
|