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