|
@@ -506,8 +506,10 @@ func (p *Player) SetPassiveInviteReward() {
|
|
|
if !ok || !tok || c != p.Level {
|
|
|
return
|
|
|
}
|
|
|
- //获取邀请人
|
|
|
+ //被邀请人
|
|
|
key := fmt.Sprintf("%v:1:%v", constant.InviteKey, p.UserName)
|
|
|
+
|
|
|
+ //获取邀请人
|
|
|
pUid := mdb.RDB.Get(context.Background(), key).Val()
|
|
|
|
|
|
pbase, err := mdb.RDB.Get(context.Background(), GetPlayBaseKey(pUid)).Bytes()
|
|
@@ -581,6 +583,7 @@ func (p *Player) SetInviteReward() {
|
|
|
key1 := fmt.Sprintf("%v:%v:%v", constant.InviteKey, InvitePlayer, p.UserName)
|
|
|
key2 := fmt.Sprintf("%v:%v:%v", constant.InviteKey, InviteVipPlayer, p.UserName)
|
|
|
|
|
|
+ //自己作为邀请人判断奖励
|
|
|
freeNum, _ := mdb.RDB.Get(context.Background(), key1).Int()
|
|
|
|
|
|
VipNum, _ := mdb.RDB.Get(context.Background(), key2).Int()
|
|
@@ -643,13 +646,13 @@ func (p *Player) SetInvite(uid string) bool {
|
|
|
//}
|
|
|
//return true
|
|
|
|
|
|
- key := fmt.Sprintf("%v:1:%v", constant.InviteKey, uid)
|
|
|
+ key := fmt.Sprintf("%v:1:%v", constant.InviteKey, p.UserName)
|
|
|
ret, ok := data.DiscreteRuleConfig.Get(InviteMaxExpireTime)
|
|
|
if !ok {
|
|
|
return false
|
|
|
}
|
|
|
t, _ := mhayaString.ToInt64(ret.Condition)
|
|
|
- err := mdb.RDB.Set(context.Background(), key, p.UserName, time.Duration(t)*24*time.Hour).Err()
|
|
|
+ err := mdb.RDB.Set(context.Background(), key, uid, time.Duration(t)*24*time.Hour).Err()
|
|
|
if err != nil {
|
|
|
return false
|
|
|
}
|