Browse Source

搜索更新

xingzai 3 years ago
parent
commit
eea398efd8
1 changed files with 9 additions and 1 deletions
  1. 9 1
      controllers/activity.go

+ 9 - 1
controllers/activity.go

@@ -2255,6 +2255,7 @@ func (this *ActivityCoAntroller) LabelMoreList() {
 // @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
 // @Param   ActiveState   query   string  false       "活动进行状态 未开始:1、进行中2、已结束3"
 // @Param   Label   query   string  false       "搜索主题 多个用 , 隔开"
+// @Param   ActivityTypeId   query   int  false       "活动类型ID"
 // @Success 200 {object} models.GetCygxActivityListRep
 // @router /listNew [get]
 func (this *ActivityCoAntroller) ActivityListNew() {
@@ -2272,6 +2273,7 @@ func (this *ActivityCoAntroller) ActivityListNew() {
 	uid := user.UserId
 	pageSize, _ := this.GetInt("PageSize")
 	currentIndex, _ := this.GetInt("CurrentIndex")
+	activityTypeId, _ := this.GetInt("ActivityTypeId")
 	label := this.GetString("Label")
 	activeState := this.GetString("ActiveState")
 	if label == "undefined" {
@@ -2314,6 +2316,12 @@ func (this *ActivityCoAntroller) ActivityListNew() {
 		sqlExport += ` OR  art.customer_type_ids LIKE '%4%' `
 	}
 	sqlExport += `) `
+
+	//活动类型
+	if activityTypeId > 0 {
+		condition += ` AND art.activity_type_id  IN (` + strconv.Itoa(activityTypeId) + `)`
+		activeState = "1"
+	}
 	//主题
 	if label != "" {
 		condition = ` AND art.label  LIKE '%` + label + `%' `
@@ -2335,6 +2343,7 @@ func (this *ActivityCoAntroller) ActivityListNew() {
 	} else {
 		conditionOr += `	OR ( art.is_limit_people = 0 	  ` + condition + `) `
 	}
+
 	condition += ` AND art.is_limit_people = 1 ` + permissionSqlStr + sqlExport + conditionOr
 	total, err := models.GetActivityCount(condition, pars)
 	if err != nil {
@@ -2402,7 +2411,6 @@ func (this *ActivityCoAntroller) ActivityListNew() {
 		if v.ChartPermissionName == "研选" && v.ActivityTypeId == 1 {
 			list[k].ActivityTypeName = "研选电话会"
 		}
-		fmt.Println(v.ChartPermissionName)
 		if v.ActivityType == 0 {
 			if mapAddress[v.City] != "" {
 				list[k].ImgUrl = mapAddress[v.City]