wangshan 1 год назад
Родитель
Сommit
73601614d6

+ 1 - 0
src/jfw/modules/publicapply/src/activityday/consts/consts.go

@@ -22,6 +22,7 @@ var (
 	PointTypeConsume            int64 = 2008
 	PointTypeHarvest            int64 = 1019
 	RedisCode                         = "other"
+	RedisNewCode                      = "newother"
 	RafflePool                        = make(chan bool, 1)
 	PrizeKey                          = "activity_day_%s_%d_%d_%d" //奖品名称  活动id  奖品id 日期
 	RepeatKey                         = "activity_day_action_%d"

+ 2 - 2
src/jfw/modules/publicapply/src/activityday/dao/dao.go

@@ -48,10 +48,10 @@ func GetLotteryActiveInfo(activeId int64, sess map[string]interface{}, session *
 	if r.DLai.ActiveStartTime <= now.Unix() && r.DLai.ActiveEndTime >= now.Unix() {
 		//首次访问活动页面 赠送剑鱼币100
 		onceKey := fmt.Sprintf("activity_day_once_%s", r.UserInfo.UserId)
-		if ok, err := redis.Exists(consts.RedisCode, onceKey); err != nil && ok {
+		if ok, err := redis.Exists(consts.RedisNewCode, onceKey); err == nil && !ok {
 			err = r.PointHarvest(r.DLai.Cost)
 			if err == nil {
-				redis.Put(consts.RedisCode, onceKey, now.Day(), 30*24*60*60)
+				redis.Put(consts.RedisNewCode, onceKey, now.Day(), 30*24*60*60)
 			} else {
 				log.Println("--首次 赠送--err -:", err.Error())
 			}

+ 6 - 3
src/jfw/modules/publicapply/src/activityday/dao/jyPoint.go

@@ -28,12 +28,15 @@ func (r *RaffleInfo) PointConsume(cost int64) (err error) {
 
 // 积分新增
 func (r *RaffleInfo) PointHarvest(coin int64) (err error) {
+	if coin == 0 {
+		coin = common.Int64All(r.Prize.JyPrize)
+	}
 	var (
 		endData  = time.Now().AddDate(1, 0, 0).Format(date.Date_Short_Layout)
-		abstract = fmt.Sprintf("抽奖活动奖品剑鱼币+%r", r.DLai.Cost)
+		abstract = fmt.Sprintf("抽奖活动奖品剑鱼币+%d", coin)
 	)
-	if coin == 0 {
-		coin = common.Int64All(r.Prize.JyPrize)
+	if coin == r.DLai.Cost {
+		abstract = fmt.Sprintf("抽奖活动+%d", coin)
 	}
 	res, err_ := config.Middleground.JyPoints.PointHarvest(r.UserInfo.UserId, consts.AppId, endData, strconv.FormatInt(consts.PointTypeHarvest, 10), abstract, coin, consts.PointTypeHarvest, false)
 	if err_ != nil {