Commit 673612a2 by mushishixian

fix

parent d1d7af2a
......@@ -77,7 +77,7 @@ func UpdateSupplierSkuMode(supplierId, skuMode int) (err error) {
}
supplier.SkuMode = skuMode
//还要去写映射表lie_supplier_merger_mapping
_, err = Dao.GetDb("supplier").Table("lie_supplier_channel").Cols("sku_mode").Where("supplier_id = ?", supplierId).Update(supplier)
_, err = Dao.GetDb("supplier").Table("lie_supplier_channel").Where("supplier_id = ?", supplierId).Cols("sku_mode").Update(supplier)
if err != nil {
return err
}
......
......@@ -33,6 +33,7 @@ func SaveSkuModeFromES() (err error) {
}
result := resp.String()
goodsIdArr := gjson.Get(result, "data.goods_id").Array()
fmt.Println("当前处理供应商为 : ", supplier.SupplierName)
if len(goodsIdArr) > 0 {
//取一个goods_id就好
goodsId := goodsIdArr[0].String()
......@@ -41,7 +42,7 @@ func SaveSkuModeFromES() (err error) {
redisCon := dao.Dao.GetRedisDbGroup("sku")
result := redisCon.HGet("goods_tag", goodsId).String()
goodsLabel := gjson.Get(result, "goods_label").Int()
//fmt.Println("供应商名称 : "+supplier.SupplierName+" goods_label为 : ", goodsLabel)
fmt.Println("供应商名称 : "+supplier.SupplierName+" goods_label为 : ", goodsLabel)
if int(goodsLabel) != 0 {
fmt.Println(supplier.SupplierId, goodsLabel)
err = dao.UpdateSupplierSkuMode(supplier.SupplierId, int(goodsLabel))
......@@ -55,7 +56,7 @@ func SaveSkuModeFromES() (err error) {
return err
}
}
}else{
} else {
err = dao.UpdateSupplierSkuMode(supplier.SupplierId, 0)
if err != nil {
return err
......
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