Browse Source

no message

xingzai 2 years ago
parent
commit
b7e7adcc0c
3 changed files with 16 additions and 2 deletions
  1. 1 0
      controllers/activity.go
  2. 1 1
      models/activity.go
  3. 14 1
      services/activity_special.go

+ 1 - 0
controllers/activity.go

@@ -3675,6 +3675,7 @@ func (this *ActivityCoAntroller) SpecialSignupAdd() {
 			br.ErrMsg = "获取日程数量信息失败,Err:" + err.Error()
 			return
 		}
+		resp.SignupStatus = 1
 		//判断是删除还是添加
 		if total == 0 {
 			//获取销售信息

+ 1 - 1
models/activity.go

@@ -791,7 +791,7 @@ func GetActivityLabelSpecialListAll(condition string, pars []interface{}, startS
 	if condition != "" {
 		sql += condition
 	}
-	sql += ` ORDER BY art.last_updated_time DESC  LIMIT ?,? `
+	sql += `  LIMIT ?,? `
 	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
 	return
 }

+ 14 - 1
services/activity_special.go

@@ -114,10 +114,23 @@ func GetActivityLabelSpecialList(user *models.WxUserItem, isPower int, chartPerm
 	if chartPermissionIds != "" {
 		condition += ` AND art.chart_permission_id  IN (` + chartPermissionIds + `) `
 	}
-	specialList, err := models.GetActivityLabelSpecialListAll(condition, pars, 0, 8)
+	conditionTrip := condition
+	conditionTrip += ` AND art.days > 0  ORDER BY art.activity_time ASC `
+	specialList, err := models.GetActivityLabelSpecialListAll(conditionTrip, pars, 0, 8)
 	if err != nil {
 		return
 	}
+	if len(specialList) < 8 {
+		conditionTrip += ` AND art.days = 0  ORDER BY art.last_updated_time DESC`
+		specialListNotrip, e := models.GetActivityLabelSpecialListAll(condition, pars, 0, 8-len(specialList))
+		if e != nil {
+			err = e
+			return
+		}
+		for _, v := range specialListNotrip {
+			specialList = append(specialList, v)
+		}
+	}
 	for k2, v2 := range specialList {
 		specialList[k2].KeyWord = LabelStrV5(v2.KeyWord, v2.IsShowSubjectName, v2.TemporaryLabel)
 		specialList[k2].ImgUrlBg = "https://hzstatic.hzinsights.com/static/temp/20220426202204/20220426/XDLLsjC9XAAy8LIzQr7GsjrBbtX6.png"