Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
8ffe184dd0
@ -10,7 +10,7 @@ import (
|
|||||||
const (
|
const (
|
||||||
gameRtask = "game_rdtask.json"
|
gameRtask = "game_rdtask.json"
|
||||||
gameRtaskChoose = "game_rdtaskchoose.json"
|
gameRtaskChoose = "game_rdtaskchoose.json"
|
||||||
gameTaskCond = "game_taskcond.json"
|
gameTaskCond = "game_rdtaskcondi.json"
|
||||||
gameRtaskSide = "game_rdtaskside.json"
|
gameRtaskSide = "game_rdtaskside.json"
|
||||||
gameRtaskBattle = "game_rdtaskbattle.json"
|
gameRtaskBattle = "game_rdtaskbattle.json"
|
||||||
)
|
)
|
||||||
@ -24,7 +24,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
|||||||
err = this.LoadMultiConfigure(map[string]interface{}{
|
err = this.LoadMultiConfigure(map[string]interface{}{
|
||||||
gameRtask: cfg.NewGameRdtask,
|
gameRtask: cfg.NewGameRdtask,
|
||||||
gameRtaskChoose: cfg.NewGameRdtaskChoose,
|
gameRtaskChoose: cfg.NewGameRdtaskChoose,
|
||||||
gameTaskCond: cfg.NewGameTaskCond,
|
gameTaskCond: cfg.NewGameRdtaskCondi,
|
||||||
gameRtaskSide: cfg.NewGameRdtaskSide,
|
gameRtaskSide: cfg.NewGameRdtaskSide,
|
||||||
gameRtaskBattle: cfg.NewGameRdtaskBattle,
|
gameRtaskBattle: cfg.NewGameRdtaskBattle,
|
||||||
})
|
})
|
||||||
|
@ -43,7 +43,9 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.SociatyAgreeReq) (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 发邮件
|
// 发邮件
|
||||||
this.module.modelSociaty.sendMail("GuildApproved", []string{sociaty.Name}, []string{uid})
|
if err := this.module.modelSociaty.sendMail("GuildApproved", []string{sociaty.Name}, []string{req.Uid}); err != nil {
|
||||||
|
this.module.Errorf("发送邮件id:GuildApproved uid:%v 失败 err:%v", uid, err)
|
||||||
|
}
|
||||||
|
|
||||||
//审核通过推送
|
//审核通过推送
|
||||||
this.module.SendMsgToUser(string(this.module.GetType()), "pagree", &pb.SociatyPAgreePush{
|
this.module.SendMsgToUser(string(this.module.GetType()), "pagree", &pb.SociatyPAgreePush{
|
||||||
|
@ -388,7 +388,7 @@ func (this *ModelSociaty) addMember(uid string, sociaty *pb.DBSociaty) error {
|
|||||||
|
|
||||||
// 发邮件给公会成员
|
// 发邮件给公会成员
|
||||||
func (this *ModelSociaty) sendMail(confId string, params []string, receiver []string) error {
|
func (this *ModelSociaty) sendMail(confId string, params []string, receiver []string) error {
|
||||||
if module, err := this.moduleSociaty.service.GetModule(comm.ModuleMail); err == nil {
|
if module, err := this.service.GetModule(comm.ModuleMail); err == nil {
|
||||||
if mail, ok := module.(comm.Imail); ok {
|
if mail, ok := module.(comm.Imail); ok {
|
||||||
mail.SendNewMail(&pb.DBMailData{
|
mail.SendNewMail(&pb.DBMailData{
|
||||||
Cid: confId,
|
Cid: confId,
|
||||||
@ -554,12 +554,12 @@ func (this *ModelSociaty) accuse(sociaty *pb.DBSociaty) error {
|
|||||||
//会长离线时间
|
//会长离线时间
|
||||||
now := time.Now().Unix()
|
now := time.Now().Unix()
|
||||||
left := now - user.Offlinetime
|
left := now - user.Offlinetime
|
||||||
if left < int64(ggd.GuildImpeachmentCountDown*3600) || user.Offlinetime == 0 {
|
if left < int64(ggd.GuildInitiateImpeachmentTime*3600) || user.Offlinetime == 0 {
|
||||||
return errors.New("会长很称职,无需弹劾")
|
return errors.New("会长很称职,无需弹劾")
|
||||||
} else {
|
} else {
|
||||||
//更新会长的弹劾时间
|
//更新会长的弹劾倒计时时间
|
||||||
update := map[string]interface{}{
|
update := map[string]interface{}{
|
||||||
"accuseTime": time.Now().Unix(),
|
"accuseTime": utils.AddHour(int(ggd.GuildImpeachmentCountDown)),
|
||||||
}
|
}
|
||||||
return this.updateSociaty(sociaty.Id, update)
|
return this.updateSociaty(sociaty.Id, update)
|
||||||
}
|
}
|
||||||
@ -573,9 +573,9 @@ func (this *ModelSociaty) extendJob(srcMasterId string, sociaty *pb.DBSociaty) e
|
|||||||
if ggd == nil {
|
if ggd == nil {
|
||||||
return errors.New("config not found")
|
return errors.New("config not found")
|
||||||
}
|
}
|
||||||
now := time.Now().Unix()
|
|
||||||
//终止弹劾
|
//终止弹劾
|
||||||
if now-sociaty.AccuseTime < int64(ggd.GuildImpeachmentCountDown*3600) {
|
now := time.Now().Unix()
|
||||||
|
if now < sociaty.AccuseTime {
|
||||||
update := map[string]interface{}{
|
update := map[string]interface{}{
|
||||||
"accuseTime": 0,
|
"accuseTime": 0,
|
||||||
}
|
}
|
||||||
|
@ -277,8 +277,12 @@ func (this *DBModel) ChangeList(uid string, _id string, data map[string]interfac
|
|||||||
|
|
||||||
option := newDBOption(opt...)
|
option := newDBOption(opt...)
|
||||||
if option.IsMgoLog {
|
if option.IsMgoLog {
|
||||||
|
if uid == "" {
|
||||||
|
err = this.UpdateModelLogs(this.TableName, uid, bson.M{"_id": _id}, data)
|
||||||
|
}else{
|
||||||
err = this.UpdateModelLogs(this.TableName, uid, bson.M{"_id": _id, "uid": uid}, data)
|
err = this.UpdateModelLogs(this.TableName, uid, bson.M{"_id": _id, "uid": uid}, data)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if this.Expired > 0 {
|
if this.Expired > 0 {
|
||||||
this.conn.UpDateModelExpired(this.ukey(uid), nil, this.Expired)
|
this.conn.UpDateModelExpired(this.ukey(uid), nil, this.Expired)
|
||||||
// this.Redis.Expire(this.ukey(uid), option.Expire)
|
// this.Redis.Expire(this.ukey(uid), option.Expire)
|
||||||
|
Loading…
Reference in New Issue
Block a user