|
@@ -58,8 +58,12 @@ func (this *BigVipBaseMsg) SubVipPortraitTimesCheck(mysql *mysql.Mysql, entId st
|
|
|
|
|
|
//校验本月次数是否使用完
|
|
|
useKey := fmt.Sprintf(PortraitRecordTimes, this.Uid, int(now.Month()))
|
|
|
-
|
|
|
useCount := redis.GetInt(PowerCacheDb, useKey)
|
|
|
+ if this.Vip_BuySet.AreaCount == -1 {
|
|
|
+ fullCount = 16 * OneAreaTimes //全国全国行业
|
|
|
+ } else {
|
|
|
+ fullCount = this.Vip_BuySet.AreaCount * OneAreaTimes
|
|
|
+ }
|
|
|
if useCount >= fullCount {
|
|
|
return fmt.Errorf("本月次数已使用完")
|
|
|
}
|
|
@@ -67,12 +71,6 @@ func (this *BigVipBaseMsg) SubVipPortraitTimesCheck(mysql *mysql.Mysql, entId st
|
|
|
//并发控制
|
|
|
if redis.Incr(PowerCacheDb, fmt.Sprintf(UsePortraitVisited, this.Uid, int(now.Month()), entId)) == 1 {
|
|
|
_ = redis.SetExpire(PowerCacheDb, fmt.Sprintf(UsePortraitVisited, this.Uid, int(now.Month()), entId), 60*60*5)
|
|
|
- if this.Vip_BuySet.AreaCount == -1 {
|
|
|
- fullCount = 16 * OneAreaTimes //全国全国行业
|
|
|
- } else {
|
|
|
- fullCount = this.Vip_BuySet.AreaCount * OneAreaTimes
|
|
|
- }
|
|
|
-
|
|
|
//新增使用记录
|
|
|
if mysql.Insert(PortraitRecordTable, map[string]interface{}{
|
|
|
"user_id": this.Uid,
|