|
@@ -1,21 +1,19 @@
|
|
package activity
|
|
package activity
|
|
|
|
|
|
import (
|
|
import (
|
|
- "app.yhyue.com/moapp/message/db"
|
|
|
|
- "strconv"
|
|
|
|
- "time"
|
|
|
|
-
|
|
|
|
- "app.yhyue.com/moapp/jybase/go-logger/logger"
|
|
|
|
- "github.com/gogf/gf/v2/os/gtime"
|
|
|
|
-
|
|
|
|
"app.yhyue.com/moapp/MessageCenter/rpc/type/message"
|
|
"app.yhyue.com/moapp/MessageCenter/rpc/type/message"
|
|
|
|
+ "app.yhyue.com/moapp/jybase/go-logger/logger"
|
|
. "app.yhyue.com/moapp/message/config"
|
|
. "app.yhyue.com/moapp/message/config"
|
|
|
|
+ "app.yhyue.com/moapp/message/db"
|
|
"app.yhyue.com/moapp/message/handler/award"
|
|
"app.yhyue.com/moapp/message/handler/award"
|
|
"app.yhyue.com/moapp/message/model"
|
|
"app.yhyue.com/moapp/message/model"
|
|
"app.yhyue.com/moapp/message/rpc"
|
|
"app.yhyue.com/moapp/message/rpc"
|
|
. "bp.jydev.jianyu360.cn/BaseService/pushpkg/p"
|
|
. "bp.jydev.jianyu360.cn/BaseService/pushpkg/p"
|
|
"github.com/gogf/gf/v2/os/gcfg"
|
|
"github.com/gogf/gf/v2/os/gcfg"
|
|
"github.com/gogf/gf/v2/os/gctx"
|
|
"github.com/gogf/gf/v2/os/gctx"
|
|
|
|
+ "github.com/gogf/gf/v2/os/gtime"
|
|
|
|
+ "strconv"
|
|
|
|
+ "time"
|
|
)
|
|
)
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -55,38 +53,43 @@ func NewUserActivity(msg *model.Message) {
|
|
Desc: "新用户注册奖励",
|
|
Desc: "新用户注册奖励",
|
|
})
|
|
})
|
|
// 新注册用户赠送超级订阅
|
|
// 新注册用户赠送超级订阅
|
|
|
|
+
|
|
startTime := gtime.NewFromStrLayout(gcfg.Instance().MustGet(gctx.New(), "newRegister.startTime").String(), "2006-01-02T15:04:05Z").Time
|
|
startTime := gtime.NewFromStrLayout(gcfg.Instance().MustGet(gctx.New(), "newRegister.startTime").String(), "2006-01-02T15:04:05Z").Time
|
|
entTime := gtime.NewFromStrLayout(gcfg.Instance().MustGet(gctx.New(), "newRegister.entTime").String(), "2006-01-02T15:04:05Z").Time
|
|
entTime := gtime.NewFromStrLayout(gcfg.Instance().MustGet(gctx.New(), "newRegister.entTime").String(), "2006-01-02T15:04:05Z").Time
|
|
now := time.Now()
|
|
now := time.Now()
|
|
if now.After(startTime) && now.Before(entTime) {
|
|
if now.After(startTime) && now.Before(entTime) {
|
|
- c := db.Mysql.CountBySql("SELECT count(1) FROM dataexport_order WHERE user_id = ? AND distribution_channel = 'x054'", msg.E_userId)
|
|
|
|
- if c <= 0 {
|
|
|
|
- _ = award.GivenSubVip(msg.E_userId, award.SubVip{
|
|
|
|
- Num: gcfg.Instance().MustGet(gctx.New(), "newRegister.supVip", nil).Int64(),
|
|
|
|
- ActivityCode: "newRegister",
|
|
|
|
- Date: msg.E_time,
|
|
|
|
- Desc: "2024年新用户注册赠送7天超级订阅",
|
|
|
|
- })
|
|
|
|
- err := rpc.SendMsg("新用户注册", &message.MultipleSaveMsgReq{
|
|
|
|
- UserIds: msg.E_userId,
|
|
|
|
- Title: gcfg.Instance().MustGet(gctx.New(), "newRegister.message.title", "").String(),
|
|
|
|
- Content: gcfg.Instance().MustGet(gctx.New(), "newRegister.message.content", "").String(),
|
|
|
|
- MsgType: gcfg.Instance().MustGet(gctx.New(), "newRegister.message.msgType").Int64(),
|
|
|
|
- Appid: gcfg.Instance().MustGet(gctx.New(), "newRegister.message.appid", "").String(),
|
|
|
|
- Link: gcfg.Instance().MustGet(gctx.New(), "newRegister.message.pcUrl", "").String() + "," +
|
|
|
|
- gcfg.Instance().MustGet(gctx.New(), "newRegister.message.mobileUrl", "").String() + "," +
|
|
|
|
- gcfg.Instance().MustGet(gctx.New(), "newRegister.message.mobileUrl", "").String() + "," +
|
|
|
|
- gcfg.Instance().MustGet(gctx.New(), "newRegister.message.mobileUrl", "").String(),
|
|
|
|
- AppPushUrl: gcfg.Instance().MustGet(gctx.New(), "newRegister.message.mobileUrl", "").String(),
|
|
|
|
- WxPushUrl: gcfg.Instance().MustGet(gctx.New(), "newRegister.message.wxUrl", "").String(),
|
|
|
|
- IosPushUrl: gcfg.Instance().MustGet(gctx.New(), "newRegister.message.mobileUrl", "").String(),
|
|
|
|
- })
|
|
|
|
- if err != nil {
|
|
|
|
- logger.Info("SendMsg Fail ", err)
|
|
|
|
|
|
+ if msg.E_code != "jyapp_wx_register" {
|
|
|
|
+ c := db.Mysql.CountBySql("SELECT count(1) FROM dataexport_order WHERE user_id = ? AND distribution_channel = 'x054'", msg.E_userId)
|
|
|
|
+ if c <= 0 {
|
|
|
|
+ _ = award.GivenSubVip(msg.E_userId, award.SubVip{
|
|
|
|
+ Num: gcfg.Instance().MustGet(gctx.New(), "newRegister.supVip", nil).Int64(),
|
|
|
|
+ ActivityCode: "newRegister",
|
|
|
|
+ Date: msg.E_time,
|
|
|
|
+ Desc: "2024年新用户注册赠送7天超级订阅",
|
|
|
|
+ })
|
|
|
|
+ err := rpc.SendMsg("新用户注册", &message.MultipleSaveMsgReq{
|
|
|
|
+ UserIds: msg.E_userId,
|
|
|
|
+ Title: gcfg.Instance().MustGet(gctx.New(), "newRegister.message.title", "").String(),
|
|
|
|
+ Content: gcfg.Instance().MustGet(gctx.New(), "newRegister.message.content", "").String(),
|
|
|
|
+ MsgType: gcfg.Instance().MustGet(gctx.New(), "newRegister.message.msgType").Int64(),
|
|
|
|
+ Appid: gcfg.Instance().MustGet(gctx.New(), "newRegister.message.appid", "").String(),
|
|
|
|
+ Link: gcfg.Instance().MustGet(gctx.New(), "newRegister.message.pcUrl", "").String() + "," +
|
|
|
|
+ gcfg.Instance().MustGet(gctx.New(), "newRegister.message.mobileUrl", "").String() + "," +
|
|
|
|
+ gcfg.Instance().MustGet(gctx.New(), "newRegister.message.mobileUrl", "").String() + "," +
|
|
|
|
+ gcfg.Instance().MustGet(gctx.New(), "newRegister.message.mobileUrl", "").String(),
|
|
|
|
+ AppPushUrl: gcfg.Instance().MustGet(gctx.New(), "newRegister.message.mobileUrl", "").String(),
|
|
|
|
+ WxPushUrl: gcfg.Instance().MustGet(gctx.New(), "newRegister.message.wxUrl", "").String(),
|
|
|
|
+ IosPushUrl: gcfg.Instance().MustGet(gctx.New(), "newRegister.message.mobileUrl", "").String(),
|
|
|
|
+ })
|
|
|
|
+ if err != nil {
|
|
|
|
+ logger.Info("SendMsg Fail ", err)
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ logger.Info("该用户活动时间内已经注册过", msg.E_userId)
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- logger.Info("该用户活动时间内已经注册过", msg.E_userId)
|
|
|
|
|
|
+ logger.Info("微信注册,活动不送", msg.E_userId)
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|