Commit c96c10fb by mushishixian

修改时间

parent e20f8523
Showing with 4 additions and 3 deletions
......@@ -7,7 +7,6 @@ import (
"github.com/tidwall/gjson"
"go_supplier_sever/app/dao"
"go_supplier_sever/app/model"
"time"
)
//从ES统计出sku类型,然后写到供应商的sku_mode字段
......@@ -19,6 +18,7 @@ func SaveSkuModeFromES() (err error) {
return err
}
defer rows.Close()
var num int
for rows.Next() {
err = rows.Scan(supplier)
//去es查询sku数量
......@@ -48,14 +48,15 @@ func SaveSkuModeFromES() (err error) {
if err != nil {
return err
}
num++
}
}
err = dao.UpdateSupplierSkuMode(supplier.SupplierId, 0)
if err != nil {
return err
}
time.Sleep(100 * time.Millisecond)
//time.Sleep(100 * time.Millisecond)
}
fmt.Println("执行完成")
fmt.Println("执行完成,有sku_mode的供应商数量为 : ", num)
return
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment