活动分类
This commit is contained in:
parent
6b093203f3
commit
3d2c87b003
@ -959,5 +959,6 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
HuodongWarorder = 100002 // 战令活动
|
HdTypeWarorder = 1 // 圣桃战令类型
|
||||||
|
HdTypePay = 2 // 限时类型
|
||||||
)
|
)
|
||||||
|
@ -24,7 +24,9 @@ func (this *modelHdList) Init(service core.IService, module core.IModule, comp c
|
|||||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||||
Keys: bsonx.Doc{{Key: "hdid", Value: bsonx.Int32(1)}},
|
Keys: bsonx.Doc{{Key: "hdid", Value: bsonx.Int32(1)}},
|
||||||
})
|
})
|
||||||
|
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||||
|
Keys: bsonx.Doc{{Key: "itype", Value: bsonx.Int32(1)}},
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,3 +69,16 @@ func (this *modelHdList) addHdInfo(hd *pb.DBHuodong) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 通过活动类型查找
|
||||||
|
func (this *modelHdList) getHdInfoByHdType(iType int32) (result *pb.DBHuodong, err error) {
|
||||||
|
|
||||||
|
_data := this.DBModel.DB.FindOne(comm.TableHdInfo, bson.M{"itype": iType})
|
||||||
|
|
||||||
|
result = &pb.DBHuodong{}
|
||||||
|
if err = _data.Decode(result); err != nil {
|
||||||
|
this.module.Errorln(err)
|
||||||
|
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
@ -48,7 +48,7 @@ func (this *Activity) Start() (err error) {
|
|||||||
err = this.ModuleBase.Start()
|
err = this.ModuleBase.Start()
|
||||||
|
|
||||||
if !db.IsCross() {
|
if !db.IsCross() {
|
||||||
if rst, err := this.modelhdList.getHdInfoByHdId(comm.HuodongWarorder); err == nil {
|
if rst, err := this.modelhdList.getHdInfoByHdType(comm.HdTypeWarorder); err == nil {
|
||||||
// 服务启动 获取活动信息
|
// 服务启动 获取活动信息
|
||||||
var module core.IModule
|
var module core.IModule
|
||||||
if module, err = this.service.GetModule(comm.ModuleWarorder); err == nil {
|
if module, err = this.service.GetModule(comm.ModuleWarorder); err == nil {
|
||||||
@ -57,6 +57,10 @@ func (this *Activity) Start() (err error) {
|
|||||||
m.ActivityNotice(rst)
|
m.ActivityNotice(rst)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if rst, err := this.modelhdList.getHdInfoByHdType(comm.HdTypePay); err == nil {
|
||||||
|
// 服务启动 获取活动信息
|
||||||
|
var module core.IModule
|
||||||
if module, err = this.service.GetModule(comm.ModulePay); err == nil {
|
if module, err = this.service.GetModule(comm.ModulePay); err == nil {
|
||||||
if m, ok := module.(comm.IPay); ok {
|
if m, ok := module.(comm.IPay); ok {
|
||||||
m.OpenActivity(1, rst.Stime)
|
m.OpenActivity(1, rst.Stime)
|
||||||
|
Loading…
Reference in New Issue
Block a user