新邀请活动
This commit is contained in:
parent
f1ebe57d04
commit
446e696d7e
|
|
@ -1571,6 +1571,11 @@ func BindInviteSnId(platform string, snId, inviteSnId int32, code string) error
|
|||
logger.Logger.Error("BindInviteSnId error ", err)
|
||||
return err
|
||||
}
|
||||
err = c.Update(bson.M{"snid": inviteSnId}, bson.M{"$inc": bson.M{"inum": 1}})
|
||||
if err != nil {
|
||||
logger.Logger.Error("BindInviteSnId error ", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -1652,12 +1657,12 @@ func AddInviteScore(client *newMongo.Client, sc newMongo.SessionContext, platfor
|
|||
myMoney = 0
|
||||
}
|
||||
|
||||
addNum := int64(0)
|
||||
if level == 0 && tp == common.InviteScoreTypeBind {
|
||||
addNum = 1
|
||||
}
|
||||
//addNum := int64(0)
|
||||
//if level == 0 && tp == common.InviteScoreTypeBind {
|
||||
// addNum = 1
|
||||
//}
|
||||
|
||||
_, err = playerC.UpdateOne(sc, newBson.M{"snid": psnId}, newBson.M{"$inc": bson.M{"iscore": num, "imoney": myMoney, "inum": addNum}, "$set": bson.M{"iscorets": now}})
|
||||
_, err = playerC.UpdateOne(sc, newBson.M{"snid": psnId}, newBson.M{"$inc": bson.M{"iscore": num, "imoney": myMoney}, "$set": bson.M{"iscorets": now}})
|
||||
if err != nil {
|
||||
logger.Logger.Error("AddInviteScore error ", err)
|
||||
return err
|
||||
|
|
@ -1667,7 +1672,7 @@ func AddInviteScore(client *newMongo.Client, sc newMongo.SessionContext, platfor
|
|||
data := model.RankInvite{
|
||||
Platform: platform,
|
||||
SnId: psnId,
|
||||
Num: res.INum + addNum,
|
||||
Num: res.INum,
|
||||
Score: res.IScore + num,
|
||||
Ts: now.Unix(),
|
||||
Week: common.GetWeekStartTs(now.Unix()),
|
||||
|
|
|
|||
Loading…
Reference in New Issue