Compare commits

..

2 Commits

Author SHA1 Message Date
b46271a111 Merge pull request '🐛 Fix a bug.' (#19) from hotfix into main
All checks were successful
BuildImage / build-image (push) Successful in 1m15s
Reviewed-on: #19
2024-01-25 16:33:59 +08:00
5d11cc7c8a 🐛 Fix a bug. 2024-01-25 16:33:45 +08:00
2 changed files with 13 additions and 14 deletions

View File

@ -1,7 +1,6 @@
package entity
import (
"go-wechat/common/types"
"time"
)
@ -13,7 +12,7 @@ type Friend struct {
Nickname string `json:"nickname"` // 昵称
Pinyin string `json:"pinyin"` // 昵称拼音大写首字母
PinyinAll string `json:"pinyinAll"` // 昵称全拼
LastActive types.DateTime `json:"lastActive"` // 最后活跃时间
LastActive time.Time `json:"lastActive"` // 最后活跃时间
EnableAi bool `json:"enableAI" gorm:"type:tinyint(1) default 0 not null"` // 是否使用AI
AiModel string `json:"aiModel"` // AI模型
EnableChatRank bool `json:"enableChatRank" gorm:"type:tinyint(1) default 0 not null"` // 是否使用聊天排行

View File

@ -73,7 +73,7 @@ func updateLastActive(msg entity.Message) {
err = client.MySQL.Model(&entity.GroupUser{}).
Where("group_id = ?", msg.FromUser).
Where("wxid = ?", msg.GroupUser).
Update("last_active", msg.CreateTime).Error
Update("last_active", msg.CreateAt).Error
if err != nil {
log.Printf("更新群成员最后活跃时间失败, 错误信息: %v", err)
}
@ -81,7 +81,7 @@ func updateLastActive(msg entity.Message) {
// 更新群或者好友活跃时间
err = client.MySQL.Model(&entity.Friend{}).
Where("wxid = ?", msg.FromUser).
Update("last_active", msg.CreateTime).Error
Update("last_active", msg.CreateAt).Error
if err != nil {
log.Printf("更新群或者好友活跃时间失败, 错误信息: %v", err)
}