Kaynağa Gözat

feat:缓存

wangshan 2 yıl önce
ebeveyn
işleme
abfc8f894c

+ 5 - 13
handler/activity/jyActivityOther.go

@@ -56,7 +56,7 @@ func (BP *JyActivity) ShareFinish(userId string) error {
 // todayBalance 今日余额
 // 允许参加预热活动 用户注册时间限制
 // err 异常
-func (BP *JyActivity) GetDailyBoonDetail(userId string) (has bool, todayBalance int, registerBool, questionsBool bool, err error) {
+func (BP *JyActivity) GetDailyBoonDetail(userId string) (has bool, todayBalance int, registerBool bool, err error) {
 	if preHeatTime, _, _ := BP.InActivity(); !preHeatTime {
 		err = fmt.Errorf("不在预热活动时间内")
 		return
@@ -70,8 +70,8 @@ func (BP *JyActivity) GetDailyBoonDetail(userId string) (has bool, todayBalance
 	if todayBalance < 0 {
 		todayBalance = 0
 	}
-	//默认问卷已提交  注册时间也在活动允许范围内
-	questionsBool, registerBool = true, true
+	// 注册时间也在活动允许范围内
+	registerBool = true
 	//是否有权限领取
 	powerSwitch := gcfg.Instance().MustGet(gctx.New(), "jyactivity.power.switch", false).Bool()
 	//权限判断及问卷调查开关
@@ -79,16 +79,13 @@ func (BP *JyActivity) GetDailyBoonDetail(userId string) (has bool, todayBalance
 		registerTime := gcfg.Instance().MustGet(gctx.New(), "jyactivity.power.time", 1609430400).Int64()
 		//注册时间是否在允许范围内
 		registerBool = registerTime < award.GetUserRegisterTime(userId)
-		//问卷是否提交
-		rsKey := fmt.Sprintf(QuestionnaireSubmit, userId)
-		questionsBool = redis.GetInt(BidderPlanRedis, rsKey) > 0
 	}
 	return
 }
 
 // GetDailyBoonSVip 每日限量超级订阅领取
 func (BP *JyActivity) GetDailyBoonSVip(userId string) (err error) {
-	var has, questionsBool bool = false, false
+	var has bool = false
 	var todayBalance int = -1
 
 	var startTime time.Time
@@ -103,15 +100,10 @@ func (BP *JyActivity) GetDailyBoonSVip(userId string) (err error) {
 		return
 	}
 
-	has, todayBalance, _, questionsBool, err = BP.GetDailyBoonDetail(userId)
+	has, todayBalance, _, err = BP.GetDailyBoonDetail(userId)
 	if err != nil {
 		return
 	}
-	//问卷是否提交
-	if !questionsBool {
-		err = fmt.Errorf("问卷未提交")
-		return
-	}
 	if has {
 		err = fmt.Errorf("已领取")
 		return

+ 1 - 1
services/activity/bidderPlan/services.go

@@ -184,7 +184,7 @@ func (act *Activity) DoShare() {
 func (act *Activity) GetDailyBoonDetail() {
 	userId := gconv.String(act.GetSession("userId"))
 	rData, errMsg := func() (map[string]interface{}, error) {
-		has, todayBalance, registerBool, _, err := activity.MembershipDay.GetDailyBoonDetail(userId)
+		has, todayBalance, registerBool, err := activity.MembershipDay.GetDailyBoonDetail(userId)
 		if err != nil {
 			return nil, err
 		}