获取主城进度

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

View File

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

View File

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