Browse Source

Merge branch 'master' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

xingzai 1 year ago
parent
commit
ec3987af06
3 changed files with 7 additions and 8 deletions
  1. 1 1
      controllers/banner.go
  2. 1 1
      controllers/tactics.go
  3. 5 6
      services/user_label.go

+ 1 - 1
controllers/banner.go

@@ -31,7 +31,7 @@ func (this *BannerController) List() {
 	resp := new(models.CygxBannerListResp)
 	var condition string
 	var pars []interface{}
-	condition += "	 AND art.status = 1 ORDER BY art. list_type ASC   , art.sort ASC  "
+	condition += " AND art.show_type IN (0,1)	 AND art.status = 1 ORDER BY art. list_type ASC   , art.sort ASC  "
 	list, err := models.GetCygxBannerList(condition, pars, 0, 99999)
 	if err != nil {
 		br.Msg = "获取失败"

+ 1 - 1
controllers/tactics.go

@@ -65,7 +65,7 @@ func (this *TacticsController) List() {
 	var total int
 	var err error
 	if categoryId == utils.ACTEGORY_ID_AI_QY {
-		list, total, err = services.GetAiQianYanArtilceList(0, pageSize)
+		list, total, err = services.GetAiQianYanArtilceList(startSize, pageSize)
 	} else {
 		list, total, err = models.GetReportAndproductIndustrylList(categoryId, startSize, pageSize)
 	}

+ 5 - 6
services/user_label.go

@@ -735,7 +735,8 @@ func updateUserLabelByUserId(userId int) (err error) {
 			go utils.SendAlarmMsg("更新用户标签失败:"+err.Error()+"userId:"+strconv.Itoa(userId), 2)
 		}
 	}()
-	time.Sleep(1 * time.Second)
+	//加200毫秒的延迟
+	time.Sleep(200 * time.Millisecond)
 	var condition string
 	var pars []interface{}
 	condition = ` AND is_follow=1  AND  user_id = ?  `
@@ -909,7 +910,7 @@ func UpdateUserLabelWeight() (err error) {
 			items = append(items, item)
 			userLabel[fmt.Sprint("user_id{|}", user.UserId, "{|}source_id{|}", user.SourceId, "{|}source{|}", user.Source)] = true
 		}
-		userLabelWeight[fmt.Sprint("user_id{|}", user.UserId, "{|}label{|}", user.Label)]++
+		userLabelWeight[fmt.Sprint("user_id{|}", user.UserId, "{|}source_id{|}", user.SourceId, "{|}source{|}", user.Source)]++
 	}
 
 	//处理活动标签
@@ -929,7 +930,7 @@ func UpdateUserLabelWeight() (err error) {
 			items = append(items, item)
 			userLabel[fmt.Sprint("user_id{|}", user.UserId, "{|}source_id{|}", user.IndustrialManagementId, "{|}source{|}", 1)] = true
 		}
-		userLabelWeight[fmt.Sprint("user_id{|}", user.UserId, "{|}label{|}", user.Label)]++
+		userLabelWeight[fmt.Sprint("user_id{|}", user.UserId, "{|}source_id{|}", user.IndustrialManagementId, "{|}source{|}", 1)]++
 	}
 
 	//处理专项调研活动标签
@@ -949,10 +950,9 @@ func UpdateUserLabelWeight() (err error) {
 			items = append(items, item)
 			userLabel[fmt.Sprint("user_id{|}", user.UserId, "{|}source_id{|}", user.IndustrialManagementId, "{|}source{|}", 1)] = true
 		}
-		userLabelWeight[fmt.Sprint("user_id{|}", user.UserId, "{|}label{|}", user.Label)]++
+		userLabelWeight[fmt.Sprint("user_id{|}", user.UserId, "{|}source_id{|}", user.IndustrialManagementId, "{|}source{|}", 1)]++
 	}
 	var itemLimt []*models.CygxUserLabel
-	fmt.Println(len(items))
 	if len(items) > 0 {
 		for _, v := range items {
 			itemLimt = append(itemLimt, v)
@@ -984,7 +984,6 @@ func UpdateUserLabelWeight() (err error) {
 		err = errors.New("UpdateCygxUserLabelWeightAll" + e.Error())
 		return
 	}
-	fmt.Println(len(itemsUpdate))
 	e = models.UpdateCygxUserLabelMulti(itemsUpdate)
 	if e != nil {
 		err = errors.New("UpdateCygxUserLabelMulti" + e.Error())