From be6811ddbde29cc3209dbfeda1cb639217161140 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 1 Nov 2022 19:51:10 +0800 Subject: [PATCH] test cron --- pkg/common/db/mongoModel.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/common/db/mongoModel.go b/pkg/common/db/mongoModel.go index 0a4f1f8aa..719c06ccc 100644 --- a/pkg/common/db/mongoModel.go +++ b/pkg/common/db/mongoModel.go @@ -325,7 +325,7 @@ func (d *DataBases) GetNewestMsg(ID string) (msg *MsgInfo, err error) { } if len(userChats) > 0 { if len(userChats[0].Msg) > 0 { - return &userChats[0].Msg[len(userChats[0].Msg)], nil + return &userChats[0].Msg[len(userChats[0].Msg)-1], nil } return nil, errors.New("len(userChats[0].Msg) < 0") }