Browse Source

feat:活动赠送100剑鱼币开关

wangshan 1 năm trước cách đây
mục cha
commit
7b8bd97124

+ 2 - 1
src/jfw/modules/publicapply/src/activityday/config.json

@@ -38,5 +38,6 @@
     "weChatUrl": ""
   },
   "webhookURL": ["https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=78864582-d770-452f-a55d-e8d17c647f31"],
-  "drawNum": 20
+  "drawNum": 20,
+  "firstAccessSwitch": true
 }

+ 2 - 5
src/jfw/modules/publicapply/src/activityday/config/config.go

@@ -36,14 +36,14 @@ type config struct {
 		WeChatUrl    string `json:"weChatUrl"`
 	} `json:"siteMsg"`
 	WebhookURL []string `json:"webhookURL"`
-	DrawNum    int      `json:"drawNum"` //一次最大抽奖次数
+	DrawNum    int      `json:"drawNum"`           //一次最大抽奖次数
+	FASwitch   bool     `json:"firstAccessSwitch"` //首次访问 是否赠送剑鱼币 开关
 }
 
 var (
 	Config *config
 	// 发送邮件邮箱
 	GmailAuth []*mail.GmailAuth
-	FASwitch  bool //首次访问 是否赠送剑鱼币 开关---firstAccessSwitch
 )
 
 func init() {
@@ -53,9 +53,6 @@ func init() {
 	if Config.DrawNum == 0 {
 		Config.DrawNum = consts.Steps10
 	}
-	if Config.Name != "" {
-		FASwitch = true
-	}
 	for _, v := range Config.Mail {
 		mail2 := &mail.GmailAuth{
 			SmtpHost: v.Addr,

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

@@ -46,7 +46,7 @@ func GetLotteryActiveInfo(activeId int64, sess map[string]interface{}, session *
 		return
 	}
 	//活动期间
-	if r.DLai.ActiveStartTime <= now.Unix() && r.DLai.ActiveEndTime >= now.Unix() && config.FASwitch {
+	if r.DLai.ActiveStartTime <= now.Unix() && r.DLai.ActiveEndTime >= now.Unix() && config.Config.FASwitch {
 		//首次访问活动页面 赠送剑鱼币100
 		onceKey := fmt.Sprintf("activity_day_once_%s", r.UserInfo.UserId)
 		if ok, err := redis.Exists(consts.RedisNewCode, onceKey); err == nil && !ok {