forked from lxh/go-wxhelper
🐛 Fix a bug.
This commit is contained in:
parent
5d11cc7c8a
commit
244bff5714
@ -66,6 +66,7 @@ func Sync() {
|
|||||||
PinyinAll: friend.PinyinAll,
|
PinyinAll: friend.PinyinAll,
|
||||||
Wxid: friend.Wxid,
|
Wxid: friend.Wxid,
|
||||||
IsOk: true,
|
IsOk: true,
|
||||||
|
LastActive: time.Now().Local(),
|
||||||
}).Error
|
}).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("新增好友失败: %s", err.Error())
|
log.Printf("新增好友失败: %s", err.Error())
|
||||||
@ -149,14 +150,15 @@ func syncGroupUsers(tx *gorm.DB, gid string) {
|
|||||||
if count == 0 {
|
if count == 0 {
|
||||||
// 新增
|
// 新增
|
||||||
err = tx.Create(&entity.GroupUser{
|
err = tx.Create(&entity.GroupUser{
|
||||||
GroupId: gid,
|
GroupId: gid,
|
||||||
Account: cp.Account,
|
Account: cp.Account,
|
||||||
HeadImage: cp.HeadImage,
|
HeadImage: cp.HeadImage,
|
||||||
Nickname: cp.Nickname,
|
Nickname: cp.Nickname,
|
||||||
Wxid: cp.Wxid,
|
Wxid: cp.Wxid,
|
||||||
IsMember: true,
|
IsMember: true,
|
||||||
IsAdmin: wxid == baseResp.Data.Admin,
|
IsAdmin: wxid == baseResp.Data.Admin,
|
||||||
JoinTime: time.Now().Local(),
|
JoinTime: time.Now().Local(),
|
||||||
|
LastActive: time.Now().Local(),
|
||||||
}).Error
|
}).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("新增群成员失败: %s", err.Error())
|
log.Printf("新增群成员失败: %s", err.Error())
|
||||||
|
Loading…
Reference in New Issue
Block a user