xyxie 1 năm trước cách đây
mục cha
commit
7807884137

+ 1 - 1
controller/index_data/jiayue_index.go

@@ -29,7 +29,7 @@ func (j *JiaYueIndexController) GetData(c *gin.Context) {
 
 	data, err, errMsg := index_data_service.GetIndexFromJiaYue(indexCode, source, startDate, endDate)
 	if err != nil {
-		resp.FailMsg("查询失败", errMsg, c)
+		resp.FailMsg("查询失败", err.Error()+errMsg, c)
 		return
 	}
 	resp.OkData("操作成功", data, c)

+ 1 - 0
services/index_data/jiayue_platform.go

@@ -39,6 +39,7 @@ func GetIndexFromJiaYue(indexCode, source, startDate, endDate string) (data *res
 		indexId, e := strconv.Atoi(indexCode)
 		if e != nil {
 			err = fmt.Errorf("类型错误,请输入正确的指标code")
+			return
 		}
 		indexCond += " AND ID = :1 "
 		indexPars = append(indexPars, indexId)