|
@@ -159,8 +159,10 @@ func addPower(waitEmpowerId int64, entUserId int) {
|
|
|
productType := common.ObjToString((*orderData)["product_type"])
|
|
|
userId := getUserId(entUserId)
|
|
|
if productType == "VIP订阅" {
|
|
|
+ log.Println("开通超级订阅", userId)
|
|
|
openPowerVip(*orderData, userId)
|
|
|
} else if productType == "大会员" {
|
|
|
+ log.Println("开通大会员", userId)
|
|
|
openPowerBig(*orderData, userId)
|
|
|
}
|
|
|
}
|
|
@@ -337,7 +339,7 @@ func GetServerPid() map[int]int {
|
|
|
}
|
|
|
|
|
|
func RedisDel(userId string) {
|
|
|
- redis.Del(NewOther, BigKey+userId)
|
|
|
+ redis.Del(NewOther, "pl_indexMessage_"+userId)
|
|
|
cacheKey := fmt.Sprintf(PowerCacheKey, userId)
|
|
|
baseInfoCacheKey := fmt.Sprintf(IsGetUserBaseInfoRedisKey, userId)
|
|
|
redisMenuKeyPC := fmt.Sprintf(RedisMenuKeyPC, userId)
|
|
@@ -394,8 +396,7 @@ func StartSubVip(phone string, area map[string]interface{}, newBuyset SubvipBuyS
|
|
|
|
|
|
go func() {
|
|
|
MergeKws(userId)
|
|
|
- redis.Del(NewOther, "pl_indexMessage_"+userId)
|
|
|
- ClearBigVipUserPower(userId)
|
|
|
+ RedisDel(userId)
|
|
|
}()
|
|
|
if isOk {
|
|
|
return true
|
|
@@ -421,21 +422,6 @@ func MergeKws(userId string) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func ClearBigVipUserPower(userId string) {
|
|
|
- cacheKey := fmt.Sprintf(PowerCacheKey, userId)
|
|
|
- baseInfoCacheKey := fmt.Sprintf(IsGetUserBaseInfoRedisKey, userId)
|
|
|
- redisMenuKeyPC := fmt.Sprintf(RedisMenuKeyPC, userId)
|
|
|
- redisMenuKeyWX := fmt.Sprintf(RedisMenuKeyWX, userId)
|
|
|
- redisMenuKeyAPP := fmt.Sprintf(RedisMenuKeyAPP, userId)
|
|
|
- userPowerRedisKey := fmt.Sprintf(UserPowerRedisKey, time.Now().Day(), userId)
|
|
|
- redis.Del(NewOther, cacheKey)
|
|
|
- redis.Del(NewOther, baseInfoCacheKey)
|
|
|
- redis.Del(NewOther, redisMenuKeyPC)
|
|
|
- redis.Del(NewOther, redisMenuKeyWX)
|
|
|
- redis.Del(NewOther, redisMenuKeyAPP)
|
|
|
- redis.Del(NewOther, userPowerRedisKey)
|
|
|
-}
|
|
|
-
|
|
|
func delPower(id int64) {
|
|
|
data := JyMysql.FindOne(EntnichePower, map[string]interface{}{"id": id}, "", "")
|
|
|
if data != nil && len(*data) > 0 {
|
|
@@ -450,14 +436,12 @@ func delPower(id int64) {
|
|
|
productType := common.ObjToString((*orderData)["product_type"])
|
|
|
userId := getUserId(entUserId)
|
|
|
if productType == "VIP订阅" {
|
|
|
- Mgo.UpdateById("user", userId, map[string]interface{}{"$set": map[string]interface{}{"i_vip_status": -2}})
|
|
|
- ClearBigVipUserPower(userId)
|
|
|
+ Mgo.UpdateById("user", userId, map[string]interface{}{"$unset": map[string]interface{}{"i_vip_status": 1, "l_vip_starttime": 1, "l_vip_endtime": 1}})
|
|
|
} else if productType == "大会员" {
|
|
|
- Mgo.UpdateById("user", userId, map[string]interface{}{"$set": map[string]interface{}{"i_member_status": -2}})
|
|
|
- RedisDel(userId)
|
|
|
- ClearBigVipUserPower(userId)
|
|
|
+ Mgo.UpdateById("user", userId, map[string]interface{}{"$unset": map[string]interface{}{"i_member_status": 1, "i_member_starttime": 1, "i_member_endtime": 1}})
|
|
|
JyMysql.Update(BigServiceUser, map[string]interface{}{"s_userid": userId}, map[string]interface{}{"i_status": -1})
|
|
|
}
|
|
|
+ RedisDel(userId)
|
|
|
}
|
|
|
}
|
|
|
}
|