Эх сурвалжийг харах

Merge branch 'cygx_8.7' into debug

ziwen 2 жил өмнө
parent
commit
74759e6438
1 өөрчлөгдсөн 21 нэмэгдсэн , 5 устгасан
  1. 21 5
      controllers/activity.go

+ 21 - 5
controllers/activity.go

@@ -4648,9 +4648,9 @@ func (this *ActivityCoAntroller) ActivityListSearch() {
 // @Title 已结束的活动
 // @Description 获取已结束的活动接口
 // @Param   ChartPermissionIds   query   string  false     "行业id 多个用 , 隔开"
-// @Param   WhichDay   query   string  false       "哪一天 1本周、2上周,3本月,4上月"
-// @Param   IsPower   query   int  false       "是否选择有权限行业 ,1是 0 否 默认0"
-// @Param   TypeName   query   string  false       "电话会类型 ,专家电话会 分析师电话会"
+// @Param   WhichDay   query   string  false       "哪一天 1本周、2上周,3本月,4上月 可多选"
+// @Param   IsPower   query   string  false       "是否选择有权限行业 ,1是 0 否 默认0"
+// @Param   TypeName   query   string  false       "电话会类型 ,1专家电话会 2分析师电话会"
 // @Success 200 {object} models.GetCygxActivityLabelListRep
 // @router /overActivityList [get]
 func (this *ActivityCoAntroller) OverActivityList() {
@@ -4794,7 +4794,13 @@ func (this *ActivityCoAntroller) OverActivityList() {
 		} else if whichDay == "4" {
 			startDate = utils.GetLastMonthFirstDay().Format(utils.FormatDate)
 			endDate = utils.GetLastMonthLastDay().Format(utils.FormatDate)
-		}else {
+		} else if whichDay == "1,2" {
+			startDate = utils.GetLastWeekMonday().Format(utils.FormatDate)
+			endDate = utils.GetNowWeekSunday().Format(utils.FormatDate)
+		} else if whichDay == "3,4" {
+			startDate = utils.GetLastMonthFirstDay().Format(utils.FormatDate)
+			endDate = utils.GetNowMonthLastDay().Format(utils.FormatDate)
+		} else {
 			startDate = utils.GetNowWeekMonday().Format(utils.FormatDate)
 			endDate = utils.GetNowWeekSunday().Format(utils.FormatDate)
 		}
@@ -4805,7 +4811,17 @@ func (this *ActivityCoAntroller) OverActivityList() {
 		condition += ` AND art.chart_permission_id  IN (` + chartPermissionIds + `)`
 	}
 	if typeName != ""{
-		condition += ` AND art.activity_type_name = ` + "'" + typeName + " '"
+		typeSlice := strings.Split(typeName, ",")
+		tempCondition := ""
+		for _, s := range typeSlice {
+			if s == "1"{
+				tempCondition += "'专家电话会',"
+			} else if s == "2" {
+				tempCondition += "'分析师电话会',"
+			}
+		}
+		tempCondition = strings.TrimRight(tempCondition, ",")
+		condition += ` AND art.activity_type_name IN (` + tempCondition + `)`
 	}
 
 	//pageSize = 24 - len(list)