浏览代码

更新图表sort

xyxie 1 月之前
父节点
当前提交
01060cb071
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 3 2
      controllers/chart_info.go
  2. 2 0
      services/chart_info.go

+ 3 - 2
controllers/chart_info.go

@@ -6,9 +6,10 @@ import (
 	"eta/eta_forum_hub/services"
 	"eta/eta_forum_hub/utils"
 	"fmt"
-	"github.com/rdlucklib/rdluck_tools/paging"
 	"strings"
 	"time"
+
+	"github.com/rdlucklib/rdluck_tools/paging"
 )
 
 type ChartInfoController struct {
@@ -464,7 +465,7 @@ func GetChartInfoDetailFromUniqueCode(chartInfo *models.ChartInfoView, key strin
 	yearMax := 0
 	if dateType == utils.DateTypeNYears {
 		for _, v := range mappingList {
-			if v.LatestDate != "" {
+			if v.LatestDate != "" && v.LatestDate != "0000-00-00" {
 				lastDateT, tErr := time.Parse(utils.FormatDate, v.LatestDate)
 				if tErr != nil {
 					msg = "获取失败"

+ 2 - 0
services/chart_info.go

@@ -154,6 +154,7 @@ func AddChartInfo(req *models.AddChartReq, sysUserId int, sysUserRealName string
 	chartInfo.UnitEn = req.ChartInfo.UnitEn
 	chartInfo.Description = req.Description
 	chartInfo.ChartImage = req.ChartInfo.ChartImage
+	chartInfo.Sort = req.ChartInfo.Sort
 	/*newId, err := models.AddChartInfo(chartInfo)
 	if err != nil {
 		errMsg = `保存失败`
@@ -383,6 +384,7 @@ func UpdateChartInfoAndEdbInfo(req *models.AddChartReq, sysUserId int, sysUserRe
 	chartInfo.ChartImage = req.ChartInfo.ChartImage
 	chartInfo.SysUserId = req.ChartInfo.SysUserId
 	chartInfo.SysUserRealName = req.ChartInfo.SysUserRealName
+	chartInfo.Sort = req.ChartInfo.Sort
 	// 查询创建者信息
 	if req.CreatorInfo != nil {
 		creator, _ := system.GetAdminByAdminName(req.CreatorInfo.AdminName)