xingzai %!s(int64=2) %!d(string=hai) anos
pai
achega
8174ca464b
Modificáronse 3 ficheiros con 5 adicións e 6 borrados
  1. 0 1
      controllers/activity_special.go
  2. 3 3
      services/activity.go
  3. 2 2
      services/activity_special.go

+ 0 - 1
controllers/activity_special.go

@@ -49,7 +49,6 @@ func (this *ActivitySpecialController) SpecialList() {
 	}
 
 	conditionActivity := services.ActivityLabelSpecialSql(chartPermissionIds, whichDay, activeState)
-
 	list, total, errList := services.GetActivitySpecialList(user, currentIndex, pageSize, "", conditionActivity)
 	if errList != nil {
 		br.Msg = "获取失败"

+ 3 - 3
services/activity.go

@@ -108,7 +108,7 @@ 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 == "1,2" {
+		} else if whichDay == "1,2" || whichDay == "2,1" {
 			startDate = time.Now().Format(utils.FormatDate)
 			endDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)
 		} else if whichDay == "3" {
@@ -123,10 +123,10 @@ func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermi
 		} else if whichDay == "6" {
 			startDate = utils.GetLastMonthFirstDay().Format(utils.FormatDate)
 			endDate = utils.GetLastMonthLastDay().Format(utils.FormatDate)
-		} else if whichDay == "3,4" {
+		} else if whichDay == "3,4" || whichDay == "4,3" {
 			startDate = utils.GetLastWeekMonday().Format(utils.FormatDate)
 			endDate = utils.GetNowWeekSunday().Format(utils.FormatDate)
-		} else if whichDay == "5,6" {
+		} else if whichDay == "5,6" || whichDay == "6,5" {
 			startDate = utils.GetLastMonthFirstDay().Format(utils.FormatDate)
 			endDate = utils.GetNowMonthLastDay().Format(utils.FormatDate)
 		} else {

+ 2 - 2
services/activity_special.go

@@ -60,8 +60,8 @@ func ActivityLabelSpecialSql(chartPermissionIds, whichDay, activeState string) (
 		condition += ` AND art.activity_time <= ` + "'" + endDate + " 23:59:59'"
 	}
 	if activeState == "2" {
-		condition += ` AND art.activity_time <= ` + "'" + time.Now().Format(utils.FormatDateTime) + " '"
-		condition += ` AND art.activity_time_end <= ` + "'" + time.Now().Format(utils.FormatDateTime) + " '"
+		condition += ` AND art.days > 0  AND art.activity_time <= ` + "'" + time.Now().Format(utils.FormatDateTime) + " '"
+		condition += ` AND art.activity_time_end >= ` + "'" + time.Now().Format(utils.FormatDateTime) + " '"
 	}
 	return
 }