ソースを参照

Merge branch 'dev4.5.2' of http://127.0.0.1:8080/qmx/jy into dev4.5.2

zhangyuhan 4 年 前
コミット
682fb6b58d
1 ファイル変更5 行追加7 行削除
  1. 5 7
      src/jfw/modules/common/src/qfw/util/jy/subvipPortrait.go

+ 5 - 7
src/jfw/modules/common/src/qfw/util/jy/subvipPortrait.go

@@ -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,