diff --git a/business/jxstore/tempop/tempop.go b/business/jxstore/tempop/tempop.go index d4f9b68b7..5d473ffa5 100644 --- a/business/jxstore/tempop/tempop.go +++ b/business/jxstore/tempop/tempop.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "fmt" - "git.rosy.net.cn/jx-callback/business/jxstore/act" "net" "regexp" "strconv" @@ -1973,28 +1972,26 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { // } // } //} - act.RrefreshMtwmVendorAct(jxcontext.AdminCtx) - act.RrefreshEbaiVendorAct(jxcontext.AdminCtx) - //var ( - // db = dao.GetDB() - // skuNames []*model.SkuName - // id1 []int - // id2 []int - //) - //sql := ` - // SELECT * FROM sku_name where img like '%origin%' and upc <> '' ORDER BY img - //` - //dao.GetRows(db, &skuNames, sql) - //for _, skuName := range skuNames { - // data, _, err := jxutils.DownloadFileByURL("http://image.jxc4.com/1616546694origin549a181bN32f4da48.jpg") - // if data == nil || err != nil { - // id1 = append(id1, skuName.ID) - // } else { - // id2 = append(id2, skuName.ID) - // } - //} - //fmt.Println("exeNOimg id1", id1) - //fmt.Println("exeNOimg id2", id2) + var ( + db = dao.GetDB() + skuNames []*model.SkuName + id1 []int + id2 []int + ) + sql := ` + SELECT * FROM sku_name where img like '%origin%' and upc <> '' ORDER BY img + ` + dao.GetRows(db, &skuNames, sql) + for _, skuName := range skuNames { + data, _, err := jxutils.DownloadFileByURL(skuName.Img) + if len(data) == 0 && err != nil { + id1 = append(id1, skuName.ID) + } else { + id2 = append(id2, skuName.ID) + } + } + fmt.Println("exeNOimg2 id1", id1) + fmt.Println("exeNOimg2 id2", id2) return err }