Roc 2 years ago
parent
commit
4b218d5071
1 changed files with 14 additions and 14 deletions
  1. 14 14
      controllers/chart.go

+ 14 - 14
controllers/chart.go

@@ -85,39 +85,39 @@ func (this *ChartController) ChartInfoDetail() {
 	case 1:
 		startDate = "2000-01-01"
 		//endDate = time.Now().Format(utils.FormatDate)
-		endDate=""
+		endDate = ""
 	case 2:
 		startDate = "2010-01-01"
 		//endDate = time.Now().Format(utils.FormatDate)
-		endDate =""
+		endDate = ""
 	case 3:
 		startDate = "2015-01-01"
 		//endDate = time.Now().Format(utils.FormatDate)
-		endDate =""
+		endDate = ""
 	case 4:
 		startDate = strconv.Itoa(time.Now().Year()) + "-01-01"
 		startDate = "2021-01-01"
 		//endDate = time.Now().Format(utils.FormatDate)
-		endDate =""
+		endDate = ""
 	case 5:
 		startDate = startDate + "-01"
 		endDate = endDate + "-01"
 	case 6:
 		startDate = startDate + "-01"
 		//endDate = time.Now().Format(utils.FormatDate)
-		endDate =""
+		endDate = ""
 	case 7:
 		startDate = "2018-01-01"
 		//endDate = time.Now().Format(utils.FormatDate)
-		endDate =""
+		endDate = ""
 	case 8:
 		startDate = "2019-01-01"
 		//endDate = time.Now().Format(utils.FormatDate)
-		endDate =""
+		endDate = ""
 	case 9:
 		startDate = "2020-01-01"
 		//endDate = time.Now().Format(utils.FormatDate)
-		endDate =""
+		endDate = ""
 	}
 
 	if chartType == 2 {
@@ -131,7 +131,7 @@ func (this *ChartController) ChartInfoDetail() {
 			endDate = seasonEndDate + "-12-31"
 		} else {
 			//endDate = time.Now().Format(utils.FormatDate)
-			endDate =""
+			endDate = ""
 		}
 	}
 
@@ -172,7 +172,9 @@ func (this *ChartController) ChartInfoDetail() {
 
 		var startDateReal string
 		var diffSeconds int64
-		if chartType == 1 {
+		if chartType == 2 { //季节性图表
+			startDateReal = startDate
+		} else {
 			if v.EdbInfoType == 0 && v.LeadUnit != "" && v.LeadValue > 0 { //领先指标
 				var startTimeRealTemp time.Time
 				startDateParse, _ := time.Parse(utils.FormatDate, startDate)
@@ -198,8 +200,6 @@ func (this *ChartController) ChartInfoDetail() {
 			} else {
 				startDateReal = startDate
 			}
-		} else {
-			startDateReal = startDate
 		}
 		calendarPreYear := 0
 		if calendar == "农历" {
@@ -309,10 +309,10 @@ func (this *ChartController) ChartInfoDetail() {
 // @router /refresh [get]
 func (this *ChartController) ChartInfoRefresh() {
 	br := new(models.BaseResponse).Init()
-	chartId :=0
+	chartId := 0
 	defer func() {
 		// 添加日志
-		if chartId>0{
+		if chartId > 0 {
 			shareChartRefreshLogInfo := &models.ShareChartRefreshLog{
 				Ip:         this.Ctx.Input.IP(),
 				ChartId:    chartId,