上传迷宫代码

This commit is contained in:
liwei 2023-08-10 21:27:28 +08:00
parent 76f2921605
commit 3cab7559f7

View File

@ -47,3 +47,32 @@ func (this *ModelStonehengeBook) getStonehengeBook(uid string) (info *pb.DBStone
}
return
}
func (this *ModelStonehengeBook) addStonehengeBook(uid string, btype int32, bid int32) {
var (
info *pb.DBStonehengeBook
bookAward *pb.DBStonehengeBookAward
ok bool
err error
)
if info, err = this.module.modelStonehengeBook.getStonehengeBook(uid); err != nil {
this.module.Errorln(err)
return
}
if bookAward, ok = info.Award[btype]; !ok {
bookAward = &pb.DBStonehengeBookAward{
Btype: btype,
Books: make([]int32, 0),
Stage: make(map[int32]bool),
}
info.Award[btype] = bookAward
}
bookAward.Books = append(bookAward.Books, btype)
if err = this.Change(uid, map[string]interface{}{
"award": info.Award,
}); err != nil {
this.module.Errorln(err)
return
}
}