xingzai 2 lat temu
rodzic
commit
3c0b6a52ee
1 zmienionych plików z 20 dodań i 7 usunięć
  1. 20 7
      services/resource_data.go

+ 20 - 7
services/resource_data.go

@@ -39,6 +39,7 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 	var activityvideoIds []int
 	var activityvoiceIds []int
 	var activityspecialIds []int
+
 	//Source      string    `description:"资源类型 报告 :article 、图表 :newchart、微路演 :roadshow、活动 :activity、活动视频:activityvideo、活动音频:activityvoice、专项调研活动:activityspecial"`
 	for _, v := range list {
 		if v.Source == "article" {
@@ -58,6 +59,14 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 		}
 	}
 
+	//fmt.Println("articleIds", articleIds)
+	//fmt.Println("newchartIds", newchartIds)
+	//fmt.Println("roadshowIds", roadshowIds)
+	//fmt.Println("activityIds", activityIds)
+	//fmt.Println("activityvideoIds", activityvideoIds)
+	//fmt.Println("activityvoiceIds", activityvoiceIds)
+	//fmt.Println("activityspecialIds", activityspecialIds)
+
 	detail, e := models.GetConfigByCode("city_img_url")
 	if e != nil {
 		err = errors.New("GetResourceDataList, Err: " + e.Error())
@@ -96,15 +105,16 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 			imgUrlResp += strconv.Itoa(vss) + ","
 		}
 		fmt.Println(imgUrlResp)
+		fmt.Println(activityIds)
 		pars = make([]interface{}, 0)
 		condition = ` AND art.activity_id IN (` + utils.GetOrmInReplace(len(activityIds)) + `)   `
 		pars = append(pars, activityIds)
-		activityList, e := models.GetActivityListNew(condition, pars, uid, startSize, len(activityIds), 0, 0)
+		activityList, e := models.GetActivityListNew(condition, pars, uid, 0, len(activityIds), 0, 0)
 		if e != nil {
 			err = errors.New("GetResourceDataList, Err: " + e.Error())
 			return
 		}
-		fmt.Println(len(activityList), "activityList")
+		//fmt.Println(len(activityList), "activityList")
 
 		var activityListRersp []*models.ActivityListResp
 		for _, v := range activityList {
@@ -155,7 +165,7 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 		pars = make([]interface{}, 0)
 		condition = ` AND a.chart_id IN (` + utils.GetOrmInReplace(len(newchartIds)) + `)`
 		pars = append(pars, newchartIds)
-		chartDateList, e := models.GetChartListCollection(condition, pars, uid, startSize, len(newchartIds))
+		chartDateList, e := models.GetChartListCollection(condition, pars, uid, 0, len(newchartIds))
 		if e != nil {
 			err = errors.New("GetResourceDataList, Err: " + e.Error())
 			return
@@ -173,7 +183,7 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 		pars = make([]interface{}, 0)
 		condition = ` AND art.activity_id IN (` + utils.GetOrmInReplace(len(activityspecialIds)) + `)`
 		pars = append(pars, activityspecialIds)
-		activitySpeciallist, e := models.GetCygxActivitySpecialDetailList(condition, pars, user.UserId, startSize, len(activityspecialIds))
+		activitySpeciallist, e := models.GetCygxActivitySpecialDetailList(condition, pars, user.UserId, 0, len(activityspecialIds))
 		if e != nil {
 			err = errors.New("GetCygxActivitySpecialDetailList, Err: " + e.Error())
 			return
@@ -183,7 +193,10 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 			err = errors.New("GetSpecialTripUserMap, Err: " + e.Error())
 			return
 		}
+		//fmt.Println(activitySpeciallist)
+		//fmt.Println(mapChart)
 		for _, v := range activitySpeciallist {
+			fmt.Println(v.ChartPermissionName)
 			if mapChart[v.ChartPermissionName] != "" {
 				imgUrlResp = mapChart[v.ChartPermissionName]
 			}
@@ -221,7 +234,7 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 		pars = make([]interface{}, 0)
 		condition = ` AND video_id IN (` + utils.GetOrmInReplace(len(roadshowIds)) + `)`
 		pars = append(pars, roadshowIds)
-		roadshowVideoList, e := models.GetMicroRoadshowVideoListBycondition(condition, pars, startSize, len(roadshowIds))
+		roadshowVideoList, e := models.GetMicroRoadshowVideoListBycondition(condition, pars, 0, len(roadshowIds))
 		if e != nil {
 			err = errors.New("GetResourceDataList, Err: " + e.Error())
 			return
@@ -239,7 +252,7 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 		fmt.Println(activityvideoIds)
 		condition = ` AND video_id IN (` + utils.GetOrmInReplace(len(activityvideoIds)) + `)`
 		pars = append(pars, activityvideoIds)
-		activityVideoList, e := models.GetActivityVideoList(condition, pars, startSize, len(activityvideoIds))
+		activityVideoList, e := models.GetActivityVideoList(condition, pars, 0, len(activityvideoIds))
 		if e != nil {
 			err = errors.New("GetResourceDataList, Err: " + e.Error())
 			return
@@ -265,7 +278,7 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 		pars = make([]interface{}, 0)
 		condition = ` AND activity_voice_id IN (` + utils.GetOrmInReplace(len(activityvoiceIds)) + `)`
 		pars = append(pars, activityvoiceIds)
-		activityVoiceList, e := models.GetActivityVoiceList(condition, pars, startSize, len(activityvoiceIds))
+		activityVoiceList, e := models.GetActivityVoiceList(condition, pars, 0, len(activityvoiceIds))
 		if e != nil {
 			err = errors.New("GetResourceDataList, Err: " + e.Error())
 			return