|
@@ -1,7 +1,6 @@
|
|
|
package controllers
|
|
|
|
|
|
import (
|
|
|
- "fmt"
|
|
|
"hongze/hongze_clpt/models"
|
|
|
"hongze/hongze_clpt/services"
|
|
|
"hongze/hongze_clpt/utils"
|
|
@@ -37,7 +36,7 @@ func (this *ActivityController) LabelTypeList() {
|
|
|
chartPermissionIds := this.GetString("ChartPermissionIds")
|
|
|
//isPower, _ := this.GetInt("IsPower")
|
|
|
whichDay := this.GetString("WhichDay")
|
|
|
- //activeState := this.GetString("ActiveState")
|
|
|
+ activeState := this.GetString("ActiveState")
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
|
if whichDay != "" {
|
|
@@ -58,17 +57,25 @@ func (this *ActivityController) LabelTypeList() {
|
|
|
condition += `AND activity_time BETWEEN ? AND ? `
|
|
|
pars = append(pars, startDate, endDate)
|
|
|
}
|
|
|
-
|
|
|
- condition += `AND activity_time > ? `
|
|
|
- pars = append(pars, time.Now().AddDate(0, -3, 0).Format(utils.FormatDate))
|
|
|
- activityList, err := models.GetCygxActivityList(condition, pars)
|
|
|
- for _, v := range activityList {
|
|
|
- fmt.Println(v)
|
|
|
+ if activeState == "" {
|
|
|
+ activeState = "1,2"
|
|
|
}
|
|
|
+ condition += ` AND active_state IN (` + activeState + `) `
|
|
|
+
|
|
|
// 查研观向7.4-始终查询宏观的活动
|
|
|
if chartPermissionIds != "" {
|
|
|
chartPermissionIds += ",1"
|
|
|
}
|
|
|
+
|
|
|
+ condition += `AND activity_time > ? GROUP BY label ORDER BY activity_time DESC `
|
|
|
+ pars = append(pars, time.Now().AddDate(0, -3, 0).Format(utils.FormatDate))
|
|
|
+ activityList, err := models.GetCygxActivityList(condition, pars)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
list, err := models.GetActivityTypeHomeList()
|
|
|
if err != nil {
|
|
|
br.Msg = "获取失败"
|