duxin 2 years ago
parent
commit
dddf5c1dfd
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/jfw/jyutil/classroomiInfo.go

+ 5 - 3
src/jfw/jyutil/classroomiInfo.go

@@ -84,8 +84,10 @@ func init() {
 // Course 剑鱼课堂首页课程 & 帮助中心热门视频 classify:0:中标比听课视频 1:帮助中心视频(获取所有)
 func Course(num, iType int) *[]map[string]interface{} {
 	if data := redis.Get("other", fmt.Sprintf("course_%d_%d", num, iType)); data != nil {
-		dataMap, _ := data.([]map[string]interface{})
-		return &dataMap
+		dataMap, _ := data.([]interface{})
+		log.Println("other,course", len(dataMap))
+		_d := util.ObjArrToMapArr(dataMap)
+		return &_d
 	}
 	//热门课程
 	/*var HotCourse *[]map[string]interface{}
@@ -121,7 +123,7 @@ func Course(num, iType int) *[]map[string]interface{} {
 			}
 			productPrice := util.Float64All(value["i_price"])
 			fool, discountPrice := OptimalSelection(util.InterfaceToStr(value["_id"]), productPrice, true)
-			log.Println("OptimalSelection=====", fool, discountPrice)
+			log.Println("OptimalSelection=====", fool, discountPrice, value["_id"])
 			(*LatestCourses)[key]["isDiscount"] = fool
 			if fool {
 				(*LatestCourses)[key]["discountPrice"] = productPrice - discountPrice