Browse Source

fix:领取邀请奖励后删除邀请

wangkaiyue 3 years ago
parent
commit
8702492d90
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/jfw/modules/subscribepay/src/service/userAccountInfo.go

+ 5 - 1
src/jfw/modules/subscribepay/src/service/userAccountInfo.go

@@ -371,10 +371,14 @@ func (this *UserAccount) PhoneBind() {
 					//船新用户 查看是否有邀请关系 shareRedisName
 					//船新用户 查看是否有邀请关系 shareRedisName
 					go func(openId string) {
 					go func(openId string) {
 						var shareUid string
 						var shareUid string
+						shareKey := fmt.Sprintf("rec_%s", openId)
 						if openId != "" {
 						if openId != "" {
-							shareUid = redis.GetStr(config.Config.ShareRedisName, fmt.Sprintf("rec_%s", openId))
+							shareUid = redis.GetStr(config.Config.ShareRedisName, shareKey)
 						}
 						}
 						entity.NewShareFission(userId, shareUid).AddPower(this.Request)
 						entity.NewShareFission(userId, shareUid).AddPower(this.Request)
+						if shareUid != "" {
+							redis.Del(config.Config.ShareRedisName, shareKey)
+						}
 					}(qutil.ObjToString((*uData)["s_m_openid"]))
 					}(qutil.ObjToString((*uData)["s_m_openid"]))
 				}
 				}
 				//建立关联关系
 				//建立关联关系