Browse Source

Merge branch 'master' of http://8.136.199.33:3000/cxzhang/hongze_clpt into cygx_10.5

xingzai 1 year ago
parent
commit
3093e02996
2 changed files with 9 additions and 5 deletions
  1. 3 3
      controllers/activity.go
  2. 6 2
      services/activity_special.go

+ 3 - 3
controllers/activity.go

@@ -84,7 +84,7 @@ func (this *ActivityController) LabelTypeList() {
 		activeState = ""
 	}
 	conditionActivitySpecial := services.ActivityLabelSpecialSql(chartPermissionIds, whichDay, activeState)
-	speciaItem, err := services.GetActivityLabelSpecialList(user, conditionActivitySpecial)
+	speciaItem, err := services.GetActivityLabelSpecialList(user, conditionActivitySpecial, activeState)
 	if err != nil {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取失败,Err:" + err.Error()
@@ -1733,8 +1733,8 @@ func (this *ActivityController) ActivityListSearch() {
 		}
 		list = append(list, item)
 	}
-	if len(resp.List) == 0 {
-		resp.List = make([]*models.CygxResourceDataResp, 0)
+	if len(list) == 0 {
+		list = make([]*models.CygxResourceDataResp, 0)
 	}
 	//添加活动搜索记录
 	if keyWord != "" {

+ 6 - 2
services/activity_special.go

@@ -143,7 +143,7 @@ func ActivityLabelSpecialUserSql(user *models.WxUserItem) (conditionShengji, con
 }
 
 // 处理专项调研的展示
-func GetActivityLabelSpecialList(user *models.WxUserItem, conditionActivitySpecial string) (item *models.ActivityTypeHome, err error) {
+func GetActivityLabelSpecialList(user *models.WxUserItem, conditionActivitySpecial, activeState string) (item *models.ActivityTypeHome, err error) {
 	itemList := new(models.ActivityTypeHome)
 	if user.CompanyId <= 1 {
 		itemList.List = make([]*models.CygxActivityLabelList, 0)
@@ -221,7 +221,10 @@ func GetActivityLabelSpecialList(user *models.WxUserItem, conditionActivitySpeci
 		return
 	}
 	//if len(specialList) < 80 {
-	conditionNoTrip += ` AND art.days = 0  `
+
+	if activeState == "" {
+		conditionNoTrip += ` AND art.days = 0  `
+	}
 	var conditionShengjiNoTrip string
 	var conditionZhengshiNoTrip string
 	var conditionHangYeNoTrip string
@@ -746,6 +749,7 @@ func GetActivitySpecialSearcheList(user *models.WxUserItem, condition string, st
 	if playBack == 1 {
 		conditionSpecil += `  AND art.activity_id = 0  `
 	}
+	conditionSpecil += `  AND art.publish_status = 1  `
 	list, totalSearche, e := models.GetActivitySpecialSearcheList(condition, pars, conditionSpecil, parsSpecil, startSize, pageSize)
 	if e != nil {
 		err = errors.New("GetActivitySpecialSearcheList, Err: " + e.Error())