فهرست منبع

wip:激活活动结束时间

wangshan 1 سال پیش
والد
کامیت
8f3047406d

+ 6 - 2
src/jfw/modules/app/src/active.json

@@ -9,5 +9,9 @@
 	"doubleEleven":{
 		"active_Start":1504505600,
 		"active_End":1605024000
-	}
-}
+	},
+  "activateInfo": {
+    "name": "激活活动",
+    "endTime":  1725120000
+  }
+}

+ 6 - 2
src/jfw/modules/app/src/app/config/active.go

@@ -9,9 +9,13 @@ var Active *active
 type active struct {
 	Pullnew      *pullnew
 	DoubleEleven *doubleEleven
+	ActivateInfo struct {
+		Name    string `json:"name"`
+		EndTime int64  `json:"endTime"`
+	} `json:"activateInfo"`
 }
 
-//拉新活动
+// 拉新活动
 type pullnew struct {
 	StartTime int64
 	EndTime   int64
@@ -19,7 +23,7 @@ type pullnew struct {
 	Password  string
 }
 
-//双十一活动
+// 双十一活动
 type doubleEleven struct {
 	Active_Start int64
 	Active_End   int64

+ 12 - 10
src/jfw/modules/app/src/app/filter/phonefilter.go

@@ -1,8 +1,13 @@
 package filter
 
 import (
+	qu "app.yhyue.com/moapp/jybase/common"
+	. "app.yhyue.com/moapp/jybase/date"
 	"app.yhyue.com/moapp/jybase/encrypt"
+	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
+	"app.yhyue.com/moapp/jybase/redis"
 	"fmt"
+	. "jy/src/jfw/modules/app/src/app/config"
 	utils "jy/src/jfw/modules/app/src/app/jyutil"
 	"jy/src/jfw/modules/app/src/jfw/config"
 	"log"
@@ -11,11 +16,6 @@ import (
 	"strconv"
 	"strings"
 	"time"
-
-	qu "app.yhyue.com/moapp/jybase/common"
-	. "app.yhyue.com/moapp/jybase/date"
-	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
-	"app.yhyue.com/moapp/jybase/redis"
 )
 
 type phoneFilter struct {
@@ -91,11 +91,13 @@ func (l *phoneFilter) Do() bool {
 					return true
 				}
 				if articleUrl.MatchString(l.R.URL.Path) {
-					//小程序
-					if paths := strings.Split(l.R.URL.RequestURI(), "miniprogram="); len(paths) > 0 {
-						if viewTime := encrypt.SE.Decode4Hex(paths[1]); viewTime != "" {
-							if vt, err := strconv.ParseInt(viewTime, 10, 64); err != nil && time.Now().Unix()-vt < 30 {
-								return false
+					//小程序 激活活动
+					if Active.ActivateInfo.EndTime > time.Now().Unix() {
+						if paths := strings.Split(l.R.URL.RequestURI(), "miniprogram="); len(paths) > 0 {
+							if viewTime := encrypt.SE.Decode4Hex(paths[1]); viewTime != "" {
+								if vt, err := strconv.ParseInt(viewTime, 10, 64); err != nil && time.Now().Unix()-vt < 30 {
+									return false
+								}
 							}
 						}
 					}

+ 5 - 1
src/jfw/modules/weixin/src/active.json

@@ -4,5 +4,9 @@
   "welcomeMsg": "现在购买超级订阅,买多久送多久,错过再等一年!<a href='%s'>点击去抢</a>",
   "autoRpl": "感谢使用剑鱼标讯!\n现在购买超级订阅,买多久送多久,错过再等一年!<a href='%s'>点击去抢</a>\n1.<a href='%s'>【订阅招标信息】</a>\n2.<a href='%s'>【搜索招标信息】</a>\n3.<a href='http://mp.weixin.qq.com/mp/homepage?__biz=MzIyNTM1NDUyNw==&hid=1&sn=f9e98da1975f85011ee138a4ee5cfbe8#wechat_redirect'>【产品帮助】</a>\n4.<a href='http://www.myfans.cc/30a78e9b78'>【招标社区】</a> \n5.<a href='%s'>点击这里,查看“%s”的相关招标信息</a>\n6.快速订阅:回复“订阅”加上你的关键词,比如“订阅 教学设备”\n7.如需人工协助,请回复“客服”\n8.<a href='https://web-jydev-wcj.jianyu360.cn/front/downloadapppage/normal?source=weixinAutoRpl'>下载剑鱼标讯APP,更加方便快捷</a>",
   "newyear_start": 1710345600,
-  "newyear_end": 1711123199
+  "newyear_end": 1711123199,
+  "activateInfo": {
+    "name": "激活活动",
+    "endTime":  1725120000
+  }
 }

+ 5 - 1
src/jfw/modules/weixin/src/config/active.go

@@ -4,7 +4,7 @@ import (
 	util "app.yhyue.com/moapp/jybase/common"
 )
 
-//系统配置
+// 系统配置
 type activeConfig struct {
 	Active_Start  int64  `json:"active_Start"`  //活动开始时间
 	Active_End    int64  `json:"active_End"`    //活动结束时间
@@ -12,6 +12,10 @@ type activeConfig struct {
 	WelcomeMsg    string `json:"welcomeMsg"`    //微信活动期间关注自动回复
 	Newyear_start int64  `json:"newyear_start"` //新年活动开始时间
 	Newyear_end   int64  `json:"newyear_end"`   //新年活动结束时间
+	ActivateInfo  struct {
+		Name    string `json:"name"`
+		EndTime int64  `json:"endTime"`
+	} `json:"activateInfo"`
 }
 
 var ActiveConfig activeConfig

+ 7 - 5
src/jfw/modules/weixin/src/wx/wx.go

@@ -528,11 +528,13 @@ func Subscribe(w ResponseWriter, r *Request) {
 	} else if strings.Count(r.EventKey, "_") >= 2 {
 		source = strings.SplitN(r.EventKey, "_", 2)[1]
 	}
-	//小程序 二维码  关注对应的招标信息
-	if strings.Contains(r.EventKey, "ac_") {
-		id := strings.Split(r.EventKey, "ac_")[1]
-		source = fmt.Sprintf("ac_%s", id)
-		biddingTitle, biddingUrl, subTxt = tools.GetMiniActivateBiddingInfo(id)
+	//小程序 二维码  关注对应的招标信息  激活活动 P583
+	if config.ActiveConfig.ActivateInfo.EndTime > time.Now().Unix() {
+		if strings.Contains(r.EventKey, "ac_") {
+			id := strings.Split(r.EventKey, "ac_")[1]
+			source = fmt.Sprintf("ac_%s", id)
+			biddingTitle, biddingUrl, subTxt = tools.GetMiniActivateBiddingInfo(id)
+		}
 	}
 	go saveFixedCode(openid, r.Event, source)
 	log.Println("source:", source, "---", r.EventKey)