Commit 2fcefb22 authored by hujiebin's avatar hujiebin

feat:优化ggroupId

parent 8f567d6c
......@@ -137,7 +137,7 @@ func InitCpLevel(model *domain.Model, cpId, userId1, userId2 mysql.ID) error {
// 2.记录存在
// 2.1 在有效期内,直接加points后判断新level,升级需要更新有效期
// 2.2 不有效期内,算首充,重置points后判断新level,升级需要更新有效期
func AddCpLevelPoints(model *domain.Model, cpRelation CpRelation, points mysql.Num, sceneType gift_e.GiftOperateSceneType) (err error) {
func AddCpLevelPoints(model *domain.Model, cpRelation CpRelation, points mysql.Num, sceneType gift_e.GiftOperateSceneType, sceneUid string) (err error) {
start := time.Now()
defer func() {
model.Log.Infof("AddCpLevelPoints cost:%v,err:%v", time.Now().Sub(start), err)
......@@ -294,15 +294,7 @@ func AddCpLevelPoints(model *domain.Model, cpRelation CpRelation, points mysql.N
model.Log.Errorf("")
return
}
levelMsgIdMap := map[cp_e.CpLevel]uint{
cp_e.CpLevel1: 252,
cp_e.CpLevel2: 253,
cp_e.CpLevel3: 254,
cp_e.CpLevel4: 255,
cp_e.CpLevel5: 256,
}
content := fmt.Sprintf(GetTranslate(286, users[userId1].Language), GetTranslate(levelMsgIdMap[cpLevel.Level], users[userId1].Language))
if err := rpc.SendCpUpgrade(users[userId1].Nick, users[userId2].Nick, users[userId1].Avatar, users[userId2].Avatar, uint32(cpLevel.Level), content); err != nil {
if err := rpc.SendCpUpgrade(users[userId1].Nick, users[userId2].Nick, users[userId1].Avatar, users[userId2].Avatar, uint32(cpLevel.Level), sceneUid); err != nil {
model.Log.Errorf("SendCpUpgrade fail:%v", err)
}
}()
......
......@@ -26,7 +26,7 @@ func CpGiftEvent() {
diamonds := sendGiftEvent.GiftN * sendGiftEvent.ResGift.DiamondNum
// 有cp关系
if cpRelation, exits := cp_m.GetCpRelationPair(model, sendGiftEvent.SendUserId, receiverUid); exits {
if err := cp_m.AddCpLevelPoints(model, cpRelation, diamonds, sendGiftEvent.SceneType); err != nil {
if err := cp_m.AddCpLevelPoints(model, cpRelation, diamonds, sendGiftEvent.SceneType, sendGiftEvent.SceneUid); err != nil {
model.Log.Errorf("AddCpLevelPoints fail:%v", err)
}
if err := cp_m.AddCpDayRank(model, cpRelation, diamonds); err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment