Commit 93fecd46 by mushishixian

debug

parent c4356e00
Showing with 5 additions and 7 deletions
...@@ -45,10 +45,10 @@ func (ls *LyService) GetActivityPrice(sku model.LySku, suffix string, power Powe ...@@ -45,10 +45,10 @@ func (ls *LyService) GetActivityPrice(sku model.LySku, suffix string, power Powe
//获取redis里面存储的活动相关信息 //获取redis里面存储的活动相关信息
brandIdArray := gjson.Get(activityInfo, "brand_id").Array() brandIdArray := gjson.Get(activityInfo, "brand_id").Array()
var brandIds []string var brandIds []int
for _, brandId := range brandIdArray { for _, brandId := range brandIdArray {
if brandId.String() != "" { if brandId.String() != "" {
brandIds = append(brandIds, brandId.String()) brandIds = append(brandIds, int(brandId.Int()))
} }
} }
goodsNameArray := gjson.Get(activityInfo, "goods_name").Array() goodsNameArray := gjson.Get(activityInfo, "goods_name").Array()
......
...@@ -6,9 +6,7 @@ import ( ...@@ -6,9 +6,7 @@ import (
) )
func main() { func main() {
str := `{"cn":{"max":"10000","price":"20"},"hk":{"max":69000,"price":138}}` var a = []string{"3923"}
var res interface{} var b = 3923
fmt.Println(php2go.JSONDecode([]byte(str), &res)) fmt.Println(php2go.InArray(b,a))
tem, _ := php2go.JSONEncode(res)
fmt.Println(string(tem))
} }
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