From b0c07ddee23e2d54d03636f08af19f0934857cf4 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期五, 25 八月 2023 10:32:56 +0800
Subject: [PATCH] Merge branch 'hotfix'
---
api/v1/followRecord.go | 29 ++++++++++++++++++++---------
1 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/api/v1/followRecord.go b/api/v1/followRecord.go
index 239d715..0960dcf 100644
--- a/api/v1/followRecord.go
+++ b/api/v1/followRecord.go
@@ -6,6 +6,7 @@
"aps_crm/model/response"
"aps_crm/pkg/contextx"
"aps_crm/pkg/ecode"
+ "errors"
"github.com/gin-gonic/gin"
"time"
)
@@ -172,27 +173,37 @@
// checkTimeFormat
// 妫�鏌ユ椂闂存牸寮�
-func checkTimeFormat(t string) (time.Time, error) {
+func checkTimeFormat(t string) (*model.CustomTime, error) {
if t == "" {
- t = "1900-01-01T00:00:00+08:00"
+ return nil, nil
}
location, err := time.LoadLocation("Asia/Shanghai")
if err != nil {
- return time.Time{}, err
+ return nil, err
}
- tt, err := time.Parse("2006-01-02T15:04:05.000Z", t)
+ tt, err := time.Parse("2006-01-02", t)
if err == nil {
- return tt.In(location), nil
+ ret := tt.In(location)
+ tmp := model.CustomTime(ret)
+ return &tmp, nil
}
- tt, err = time.Parse("2006-01-02T15:04:05-07:00", t)
+ tt, err = time.Parse("2006-01-02 15:04:05", t)
if err == nil {
- return tt.In(location), nil
+ ret := tt.In(location)
+ tmp := model.CustomTime(ret)
+ return &tmp, nil
}
- return time.Time{}, err
+ //tt, err = time.Parse("2006-01-02T15:04:05-07:00", t)
+ //if err == nil {
+ // ret := tt.In(location)
+ // return &ret, nil
+ //}
+
+ return nil, errors.New("invalid time format")
}
// List
@@ -210,7 +221,7 @@
return
}
- followRecords, total, errCode := followRecordService.GetFollowRecordList(params.Page, params.PageSize, params.Keyword)
+ followRecords, total, errCode := followRecordService.GetFollowRecordList(params.Page, params.PageSize, params.SearchMap)
if errCode != ecode.OK {
ctx.Fail(errCode)
return
--
Gitblit v1.8.0