Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
784a1c9106
@ -319,7 +319,7 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
|
|||||||
if req.DrawType != 1 {
|
if req.DrawType != 1 {
|
||||||
// 任务统计
|
// 任务统计
|
||||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||||
this.module.modelDrawRecode.AddDrawRecord(session, szCards)
|
this.module.modelDrawRecode.AddDrawRecord(session, req.DrawType, szCards)
|
||||||
|
|
||||||
var szHero []*pb.DBHero
|
var szHero []*pb.DBHero
|
||||||
for _, hero := range add { // 奖励一次性发放
|
for _, hero := range add { // 奖励一次性发放
|
||||||
|
@ -124,7 +124,7 @@ func (this *apiComp) SelectCard(session comm.IUserSession, req *pb.HeroSelectCar
|
|||||||
|
|
||||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||||
|
|
||||||
this.module.modelDrawRecode.AddDrawRecord(session, curSzCard)
|
this.module.modelDrawRecode.AddDrawRecord(session, 1, curSzCard)
|
||||||
|
|
||||||
this.module.HeroLibrary(session, curSzCard, szHero)
|
this.module.HeroLibrary(session, curSzCard, szHero)
|
||||||
this.module.SendTaskMsg(session, szStar, 10, 1, curSzCard)
|
this.module.SendTaskMsg(session, szStar, 10, 1, curSzCard)
|
||||||
|
@ -44,13 +44,13 @@ func (this *modelDrawRecode) Init(service core.IService, module core.IModule, co
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *modelDrawRecode) AddDrawRecord(session comm.IUserSession, curSzCard []string) {
|
func (this *modelDrawRecode) AddDrawRecord(session comm.IUserSession, drawtype int32, curSzCard []string) {
|
||||||
ExpireTime := time.Unix(configure.Now().Unix()+3*30*24*3600, 0)
|
ExpireTime := time.Unix(configure.Now().Unix()+3*30*24*3600, 0)
|
||||||
if _, err := this.DBModel.DB.InsertOne("drawrecode", &DBHeroDrawCardRecord{
|
if _, err := this.DBModel.DB.InsertOne("drawrecode", &DBHeroDrawCardRecord{
|
||||||
Id: primitive.NewObjectID().Hex(),
|
Id: primitive.NewObjectID().Hex(),
|
||||||
Uid: session.GetUserId(),
|
Uid: session.GetUserId(),
|
||||||
HeroId: curSzCard,
|
HeroId: curSzCard,
|
||||||
Drawtype: 1,
|
Drawtype: drawtype,
|
||||||
Ctime: configure.Now().Unix(),
|
Ctime: configure.Now().Unix(),
|
||||||
ExpireAt: ExpireTime,
|
ExpireAt: ExpireTime,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user