From 1c68fe00510d3558d5e33fd12a086a21a1035b52 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 13 Jun 2023 14:27:11 +0800 Subject: [PATCH] =?UTF-8?q?gm=20=E4=B8=BB=E7=BA=BF=E8=B7=B3=E8=BF=87?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/mline/module.go | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/modules/mline/module.go b/modules/mline/module.go index a037abe0c..f01d80d1d 100644 --- a/modules/mline/module.go +++ b/modules/mline/module.go @@ -114,26 +114,25 @@ func (this *Mline) ModifyMlineDataByNanduID(session comm.IUserSession, id int32) // 清除 this.modelMline.cleanChapterDataById(session.GetUserId(), del...) - _data := this.configure.GetAllChapterID() + _data := this.configure.GetAllStageByChapterID(connf.Chapterid) + + newData := &pb.DBMline{ + Id: primitive.NewObjectID().Hex(), + Uid: session.GetUserId(), + CType: connf.Episodetype, + ChapterId: connf.Chapterid, + StageId: id, + Star: map[int32]int32{}, + Award: map[int32]bool{}, + Ps: map[int32]int32{}, + } for _, v := range _data { - if v <= connf.Chapterid { - newData := &pb.DBMline{ - Id: primitive.NewObjectID().Hex(), - Uid: session.GetUserId(), - CType: connf.Episodetype, - ChapterId: v, - StageId: id, - Star: map[int32]int32{}, - Award: map[int32]bool{}, - Ps: map[int32]int32{}, - } - stageConf := this.configure.GetAllStageByChapterID(v) - for _, v := range stageConf { - newData.Star[v] = 3 - } - this.modelMline.addNewChapter(session.GetUserId(), newData) + if v <= id { + newData.Star[v] = 3 } } + this.modelMline.addNewChapter(session.GetUserId(), newData) + // 修改扩展数据 if rst, err := this.ModuleUser.GetUserExpand(session.GetUserId()); err == nil { // 统计主线进度 _mp := rst.Mline