|
@@ -1,6 +1,12 @@
|
|
|
package controllers
|
|
|
|
|
|
-import "hongze/hongze_clpt/models"
|
|
|
+import (
|
|
|
+ "fmt"
|
|
|
+ "hongze/hongze_clpt/models"
|
|
|
+ "hongze/hongze_clpt/services"
|
|
|
+ "hongze/hongze_clpt/utils"
|
|
|
+ "time"
|
|
|
+)
|
|
|
|
|
|
type ActivityController struct {
|
|
|
BaseAuthController
|
|
@@ -30,9 +36,35 @@ func (this *ActivityController) LabelTypeList() {
|
|
|
}
|
|
|
chartPermissionIds := this.GetString("ChartPermissionIds")
|
|
|
//isPower, _ := this.GetInt("IsPower")
|
|
|
- //whichDay := this.GetString("WhichDay")
|
|
|
+ whichDay := this.GetString("WhichDay")
|
|
|
//activeState := this.GetString("ActiveState")
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
+ if whichDay != "" {
|
|
|
+ var startDate string
|
|
|
+ var endDate string
|
|
|
+ if whichDay == "1" {
|
|
|
+ startDate = time.Now().Format(utils.FormatDate)
|
|
|
+ endDate = startDate
|
|
|
+ } else if whichDay == "2" {
|
|
|
+ startDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)
|
|
|
+ endDate = startDate
|
|
|
+ } else {
|
|
|
+ startDate = time.Now().Format(utils.FormatDate)
|
|
|
+ endDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)
|
|
|
+ }
|
|
|
+ startDate += " 00:00:00'"
|
|
|
+ endDate += " 23:59:59'"
|
|
|
+ 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)
|
|
|
+ }
|
|
|
// 查研观向7.4-始终查询宏观的活动
|
|
|
if chartPermissionIds != "" {
|
|
|
chartPermissionIds += ",1"
|
|
@@ -43,6 +75,7 @@ func (this *ActivityController) LabelTypeList() {
|
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ list, err = services.HandleActivityTypeHomeList(list, activityList, user)
|
|
|
resp := new(models.ActivityTypeListHomeResp)
|
|
|
resp.List = list
|
|
|
br.Ret = 200
|