新邀请活动
This commit is contained in:
parent
303f0817ca
commit
f1ebe57d04
|
|
@ -115,6 +115,9 @@ func init() {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer session.EndSession(context.Background())
|
defer session.EndSession(context.Background())
|
||||||
|
// 事务不支持创建集合和索引,需要提前创建
|
||||||
|
svc.InviteScoreCollection(log.Platform)
|
||||||
|
svc.RankInviteCollection(log.Platform)
|
||||||
|
|
||||||
var notifySnId []int32
|
var notifySnId []int32
|
||||||
// 修改积分
|
// 修改积分
|
||||||
|
|
|
||||||
|
|
@ -1664,7 +1664,7 @@ func AddInviteScore(client *newMongo.Client, sc newMongo.SessionContext, platfor
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新排行榜
|
// 更新排行榜
|
||||||
data := &model.RankInvite{
|
data := model.RankInvite{
|
||||||
Platform: platform,
|
Platform: platform,
|
||||||
SnId: psnId,
|
SnId: psnId,
|
||||||
Num: res.INum + addNum,
|
Num: res.INum + addNum,
|
||||||
|
|
@ -1672,7 +1672,7 @@ func AddInviteScore(client *newMongo.Client, sc newMongo.SessionContext, platfor
|
||||||
Ts: now.Unix(),
|
Ts: now.Unix(),
|
||||||
Week: common.GetWeekStartTs(now.Unix()),
|
Week: common.GetWeekStartTs(now.Unix()),
|
||||||
}
|
}
|
||||||
_, err = rankC.UpdateOne(sc, newBson.M{"snid": psnId, "week": data.Week}, data, options.Update().SetUpsert(true))
|
_, err = rankC.UpdateOne(sc, newBson.M{"snid": psnId, "week": data.Week}, newBson.M{"$set": data}, options.Update().SetUpsert(true))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Logger.Tracef("SaveRankInvite error:%v", err)
|
logger.Logger.Tracef("SaveRankInvite error:%v", err)
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue