|
@@ -38,9 +38,6 @@ func (this *SubscribeSet) SetAreaAndIndustry() *FuncResult {
|
|
|
|
|
|
//
|
|
|
func freeSet(area map[string]interface{}, industry []string, userId string) *FuncResult {
|
|
|
- if len(area) == 0 {
|
|
|
- return &FuncResult{false, errors.New("地区参数异常"), nil}
|
|
|
- }
|
|
|
//isfirst:是否第一次设置地区;ppb:是否购买省级订阅包; areacount:省份订阅包购买的省份数量-1:全国 无限制调整
|
|
|
isfirst, ppb, areacount := IsCanSet(userId, area)
|
|
|
//购买省份订阅包 已调整地区次数
|
|
@@ -49,12 +46,14 @@ func freeSet(area map[string]interface{}, industry []string, userId string) *Fun
|
|
|
ym := fmt.Sprint(time.Now().Year()) + "-" + fmt.Sprint(time.Now().Month())
|
|
|
if ppb {
|
|
|
ppnum = redis.GetInt(jy.PowerCacheDb, fmt.Sprintf(jy.UserUpdateAreaKey, userId, ym))
|
|
|
+ } else if len(area) == 0 {
|
|
|
+ return &FuncResult{false, errors.New("地区参数异常"), nil}
|
|
|
}
|
|
|
//免费用户未购买省份订阅包 按年算
|
|
|
year := fmt.Sprint(time.Now().Year())
|
|
|
//免费用户 已调整地区次数
|
|
|
fpnum := redis.GetInt(jy.PowerCacheDb, fmt.Sprintf(jy.UserUpdateAreaKey, userId, year))
|
|
|
- // log.Println(len(area), "pnum:", pnum)
|
|
|
+ // log.Println(len(area), "fpnum:", fpnum, "ppnum:", ppnum)
|
|
|
//第一次设置地区 || 购买全国 不扣次数
|
|
|
var issetredis = areacount > -1 && !isfirst
|
|
|
if issetredis {
|