浏览代码

fix:转换修改

duxin 2 年之前
父节点
当前提交
fa07f31c79
共有 1 个文件被更改,包括 3 次插入7 次删除
  1. 3 7
      src/jfw/jyutil/classroomiInfo.go

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

@@ -83,10 +83,6 @@ 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 := IterToMap(data)
-		return &dataMap
-	}
 	//热门课程
 	/*var HotCourse *[]map[string]interface{}
 	  hotQuery := map[string]interface{}{"i_type": 3, "i_status": 1, "l_endtime": map[string]interface{}{"$gt": time.Now().Unix()}, "l_publishtime": map[string]interface{}{"$lt": time.Now().Unix()}}
@@ -120,8 +116,8 @@ func Course(num, iType int) *[]map[string]interface{} {
 				(*LatestCourses)[key]["isExpired"] = false
 			}
 			productPrice := util.Float64All(value["i_price"])
-			fool, discountPrice := OptimalSelection(util.InterfaceToStr(value["_id"]), productPrice, true)
-			log.Println("OptimalSelection=====", fool, discountPrice, value["_id"])
+			fool, discountPrice := OptimalSelection(util.InterfaceToStr(value["_id"]), productPrice, false)
+			fmt.Println("OptimalSelection=====", fool, discountPrice, value["_id"])
 			(*LatestCourses)[key]["isDiscount"] = fool
 			if fool {
 				(*LatestCourses)[key]["discountPrice"] = productPrice - discountPrice
@@ -149,7 +145,6 @@ func Course(num, iType int) *[]map[string]interface{} {
 	  	}
 	  }*/
 	//IdFormat(LatestCourses)
-	redis.Put("other", fmt.Sprintf("course_%d_%d", num, iType), *LatestCourses, 60*60)
 
 	return LatestCourses
 }
@@ -204,6 +199,7 @@ func Getlottery(courseId string) {
 	resp, status, _ := Http_M("GET", url, appheader, param, 20)
 	lotteryArray := []interface{}{}
 	lotteryArrayKey := "lotteryArray" + "_" + courseId
+	fmt.Println("11111111", url)
 	if status != 200 && (resp == nil || len(resp) <= 0) {
 		redis.PutKV(lotteryArrayKey, lotteryArray)
 		return