|
@@ -1,6 +1,7 @@
|
|
package activity
|
|
package activity
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
+ "app.yhyue.com/moapp/message/db"
|
|
"strconv"
|
|
"strconv"
|
|
"time"
|
|
"time"
|
|
|
|
|
|
@@ -45,28 +46,6 @@ func NewUserActivity(msg *model.Message) {
|
|
if err != nil {
|
|
if err != nil {
|
|
logger.Info("SendMsg Fail ", err)
|
|
logger.Info("SendMsg Fail ", err)
|
|
}
|
|
}
|
|
- mtype := gcfg.Instance().MustGet(gctx.New(), "newRegister.message.msgType").Int64()
|
|
|
|
- if mtype == 0 {
|
|
|
|
- logger.Info(msg.E_userId, "SendMsg Fail 获取配置文件失败")
|
|
|
|
- } else {
|
|
|
|
- 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: mtype,
|
|
|
|
- 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)
|
|
|
|
- }
|
|
|
|
}()
|
|
}()
|
|
_ = award.GivenPoints(msg.E_userId, award.Points{
|
|
_ = award.GivenPoints(msg.E_userId, award.Points{
|
|
Num: gcfg.Instance().MustGet(gctx.New(), "newUserAward.points", nil).Int64(),
|
|
Num: gcfg.Instance().MustGet(gctx.New(), "newUserAward.points", nil).Int64(),
|
|
@@ -80,11 +59,34 @@ func NewUserActivity(msg *model.Message) {
|
|
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) {
|
|
- _ = 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天超级订阅",
|
|
|
|
- })
|
|
|
|
|
|
+ c := db.Mysql.CountBySql("SELECT * 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)
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|