获取主城进度

This commit is contained in:
meixiongfeng 2023-04-17 17:43:06 +08:00
parent 3345908fe7
commit 08c863333c
3 changed files with 8 additions and 15 deletions

View File

@ -180,7 +180,7 @@ type (
IMline interface {
ModifyMlineDataByNanduID(session IUserSession, id int32) (code pb.ErrorCode)
/// 查询章节ID
GetUsermLineData(uid string, chapterType int32) (chapterId int32)
GetUserMlineData(uid string, chapterType int32) (chapterId int32)
// 校验主线是否通关
CheckCommpleteStage(uid string, stageId int32) (b bool)

View File

@ -5,7 +5,6 @@ import (
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"sort"
"go.mongodb.org/mongo-driver/bson/primitive"
)
@ -154,19 +153,13 @@ func (this *Mline) ModifyMlineDataByNanduID(session comm.IUserSession, id int32)
}
return
}
func (this *Mline) GetUsermLineData(uid string, chapterType int32) (chapterId int32) {
var sz []*pb.DBMline
_szData, err := this.modelMline.getMainlineList(uid)
if err == nil {
for _, v := range _szData {
if v.ChapterId == chapterId {
sz = append(sz, _szData...)
}
func (this *Mline) GetUserMlineData(uid string, chapterType int32) (chapterId int32) {
if rst, err := this.ModuleUser.GetUserExpand(uid); err == nil { // 统计主线进度
_mp := rst.Mline
if v, ok := _mp[chapterType]; ok {
chapterId = v
return
}
sort.SliceStable(sz, func(i, j int) bool { // 排序
return sz[i].ChapterId > sz[j].ChapterId
})
}
return

View File

@ -128,7 +128,7 @@ func (this *ModelRtask) verifyRtype2(uid string, cfg *cfg.GameRdtaskCondiData) (
}
if ml, y := m.(comm.IMline); y {
qjId := ml.GetUsermLineData(uid, 1)
qjId := ml.GetUserMlineData(uid, 1)
return soEqual(qjId, cfg.Data1)
}
return