GM 修改主线扩展数据

This commit is contained in:
meixiongfeng 2023-01-31 15:22:24 +08:00
parent b0b3e3444b
commit 0ba8c286ed

View File

@ -127,7 +127,31 @@ func (this *Mline) ModifyMlineDataByNanduID(session comm.IUserSession, id int32)
this.modelMline.addNewChapter(session.GetUserId(), newData)
}
}
// 修改扩展数据
if rst, err := this.ModuleUser.GetUserExpand(session.GetUserId()); err == nil { // 统计主线进度
_mp := rst.Mline
var cType int32
conf := this.configure.GetMainChapterConf(connf.Chapterid)
if conf != nil {
cType = conf.ChapterType
}
if _mp == nil {
_mp = make(map[int32]int32, 1)
_mp[cType] = id
} else {
if v, ok := _mp[cType]; ok {
if v <= id {
_mp[cType] = id
}
} else {
_mp[cType] = id
}
}
this.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{
"mline": _mp,
})
}
return
}
func (this *Mline) GetUsermLineData(uid string, chapterType int32) (chapterId int32) {