Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
8abb284977
@ -289,14 +289,36 @@ func (this *Activity) GetHdData(session comm.IUserSession, oids []string) (resul
|
||||
)
|
||||
curTime := configure.Now().Unix()
|
||||
for _, id := range oids {
|
||||
if activity, err = this.modelhdList.getHdListByHdId(id); err != nil {
|
||||
if activity, err = this.modelhdList.getHdListByHdId(id); err == nil {
|
||||
if activity.Stime > curTime || curTime > activity.Etime { // 不在活动范围内数据不给活动记录数据
|
||||
continue
|
||||
}
|
||||
}
|
||||
if activity.Itype == pb.HdType_HdCelebration {
|
||||
if activity.Itype == pb.HdType_HdCelebration || activity.Itype == pb.HdType_HdLevel || activity.Itype == pb.HdType_HdTypeSign {
|
||||
list, _ = this.modelhdData.getHddataByOid(session.GetUserId(), id)
|
||||
|
||||
if activity.Itype == pb.HdType_HdTypeSign {
|
||||
if list.Val == 0 || !utils.IsToday(list.Lasttime) {
|
||||
list.Lasttime = curTime
|
||||
list.Val += 1
|
||||
update := make(map[string]interface{})
|
||||
update["lasttime"] = list.Lasttime
|
||||
update["val"] = list.Val
|
||||
this.modelhdData.ModifyActivityList(session.GetUserId(), list.Id, update)
|
||||
}
|
||||
}
|
||||
// 开服等级活动
|
||||
if activity.Itype == pb.HdType_HdLevel {
|
||||
if user, err := this.ModuleUser.GetUser(session.GetUserId()); err == nil {
|
||||
if list.Val != user.Lv {
|
||||
list.Val = user.Lv
|
||||
list.Lasttime = curTime
|
||||
update := make(map[string]interface{})
|
||||
update["lasttime"] = list.Lasttime
|
||||
update["val"] = list.Val
|
||||
this.modelhdData.ModifyActivityList(session.GetUserId(), list.Id, update)
|
||||
}
|
||||
}
|
||||
}
|
||||
// 获取开服庆典活动
|
||||
if activity.Itype == pb.HdType_HdCelebration {
|
||||
// key := fmt.Sprintf("%s-%s", session.GetUserId(), id)
|
||||
|
Loading…
Reference in New Issue
Block a user