From 244bff5714b08e35d7b3ea2ccf6866a735ae028e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Fri, 26 Jan 2024 12:00:29 +0800 Subject: [PATCH] :bug: Fix a bug. --- tasks/friends/friends.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tasks/friends/friends.go b/tasks/friends/friends.go index 238a737..61cc4fc 100644 --- a/tasks/friends/friends.go +++ b/tasks/friends/friends.go @@ -66,6 +66,7 @@ func Sync() { PinyinAll: friend.PinyinAll, Wxid: friend.Wxid, IsOk: true, + LastActive: time.Now().Local(), }).Error if err != nil { log.Printf("新增好友失败: %s", err.Error()) @@ -149,14 +150,15 @@ func syncGroupUsers(tx *gorm.DB, gid string) { if count == 0 { // 新增 err = tx.Create(&entity.GroupUser{ - GroupId: gid, - Account: cp.Account, - HeadImage: cp.HeadImage, - Nickname: cp.Nickname, - Wxid: cp.Wxid, - IsMember: true, - IsAdmin: wxid == baseResp.Data.Admin, - JoinTime: time.Now().Local(), + GroupId: gid, + Account: cp.Account, + HeadImage: cp.HeadImage, + Nickname: cp.Nickname, + Wxid: cp.Wxid, + IsMember: true, + IsAdmin: wxid == baseResp.Data.Admin, + JoinTime: time.Now().Local(), + LastActive: time.Now().Local(), }).Error if err != nil { log.Printf("新增群成员失败: %s", err.Error()) -- 2.45.2