Jelajahi Sumber

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

xingzai 2 tahun lalu
induk
melakukan
c99db1430d
2 mengubah file dengan 22 tambahan dan 1 penghapusan
  1. 1 1
      controllers/activity.go
  2. 21 0
      services/activity.go

+ 1 - 1
controllers/activity.go

@@ -2435,7 +2435,7 @@ func (this *ActivityCoAntroller) LabelMoreList() {
 // @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
 // @Param   Label   query   string  false       "搜索主题 多个用 , 隔开"
 // @Param   ChartPermissionIds   query   string  false     "行业id 多个用 , 隔开"
-// @Param   WhichDay   query   string  false       "哪一天 今天:1、明天:2,多个用 , 隔开"
+// @Param   WhichDay   query   string  false       "哪一天 1今天、2明天,3本周,4上周,5本月,6上月 多个用 , 隔开"
 // @Param   ActiveState   query   string  false       "活动进行状态 未开始:1、进行中2、已结束3"
 // @Param   ActivityTypeId   query   string  false     "活动类型id 多个用 , 隔开"
 // @Param   Source   query   int  false     "来源 0手机 ,1Pc 默认0"

+ 21 - 0
services/activity.go

@@ -588,6 +588,27 @@ func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermi
 		} else if whichDay == "2" {
 			startDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)
 			endDate = startDate
+		} else if whichDay == "3" {
+			startDate = utils.GetNowWeekMonday().Format(utils.FormatDate)
+			endDate = utils.GetNowWeekSunday().Format(utils.FormatDate)
+		} else if whichDay == "4" {
+			startDate = utils.GetLastWeekMonday().Format(utils.FormatDate)
+			endDate = utils.GetLastWeekSunday().Format(utils.FormatDate)
+		} else if whichDay == "5" {
+			startDate = utils.GetNowMonthFirstDay().Format(utils.FormatDate)
+			endDate = utils.GetNowMonthLastDay().Format(utils.FormatDate)
+		} else if whichDay == "6" {
+			startDate = utils.GetLastMonthFirstDay().Format(utils.FormatDate)
+			endDate = utils.GetLastMonthLastDay().Format(utils.FormatDate)
+		} else if whichDay == "1,2" {
+			startDate = time.Now().Format(utils.FormatDate)
+			endDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)
+		} else if whichDay == "3,4" {
+			startDate = utils.GetLastWeekMonday().Format(utils.FormatDate)
+			endDate = utils.GetNowWeekSunday().Format(utils.FormatDate)
+		} else if whichDay == "5,6" {
+			startDate = utils.GetLastMonthFirstDay().Format(utils.FormatDate)
+			endDate = utils.GetNowMonthLastDay().Format(utils.FormatDate)
 		} else {
 			startDate = time.Now().Format(utils.FormatDate)
 			endDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)