|
@@ -19,6 +19,7 @@ import (
|
|
|
"app.yhyue.com/moapp/jybase/mongodb"
|
|
|
"app.yhyue.com/moapp/jybase/mysql"
|
|
|
"app.yhyue.com/moapp/jybase/redis"
|
|
|
+ P "bp.jydev.jianyu360.cn/BaseService/pushpkg/p"
|
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
|
)
|
|
@@ -43,10 +44,10 @@ var (
|
|
|
)
|
|
|
|
|
|
var aboutDbMsg map[string]*AboutDbMsg = map[string]*AboutDbMsg{
|
|
|
- SubFreeFlag: &AboutDbMsg{"pushsubscribe", "subpush"},
|
|
|
- SubVipFlag: &AboutDbMsg{"pushsubscribe", "subpush"},
|
|
|
- MemberFlag: &AboutDbMsg{"pushmember", "memberpush"},
|
|
|
- EntnicheFlag: &AboutDbMsg{"pushentniche", "entnichepush"},
|
|
|
+ SubFreeFlag: &AboutDbMsg{"push.pushsubscribe", "subpush"},
|
|
|
+ SubVipFlag: &AboutDbMsg{"push.pushsubscribe", "subpush"},
|
|
|
+ MemberFlag: &AboutDbMsg{"push.pushmember", "memberpush"},
|
|
|
+ EntnicheFlag: &AboutDbMsg{"push.pushentniche", "entnichepush"},
|
|
|
}
|
|
|
|
|
|
type AboutDbMsg struct {
|
|
@@ -413,8 +414,8 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
//城市
|
|
|
city := []string{}
|
|
|
for _, v := range strings.Split(spqp.City, ",") {
|
|
|
- if IC.PushMapping.City[v] > 0 {
|
|
|
- city = append(city, fmt.Sprint(IC.PushMapping.City[v]))
|
|
|
+ if P.PushMapping.City[v] > 0 {
|
|
|
+ city = append(city, fmt.Sprint(P.PushMapping.City[v]))
|
|
|
} else {
|
|
|
city = append(city, "-1")
|
|
|
}
|
|
@@ -429,8 +430,8 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
var sqlArea = ""
|
|
|
area := []string{}
|
|
|
for _, v := range strings.Split(spqp.Area, ",") {
|
|
|
- if IC.PushMapping.Area[v] > 0 {
|
|
|
- area = append(area, fmt.Sprint(IC.PushMapping.Area[v]))
|
|
|
+ if P.PushMapping.Area[v] > 0 {
|
|
|
+ area = append(area, fmt.Sprint(P.PushMapping.Area[v]))
|
|
|
} else {
|
|
|
area = append(area, "-1")
|
|
|
}
|
|
@@ -454,7 +455,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
if spqp.Buyerclass != "" {
|
|
|
buyerclass := []string{}
|
|
|
for _, v := range strings.Split(spqp.Buyerclass, ",") {
|
|
|
- buyerclass = append(buyerclass, fmt.Sprint(IC.PushMapping.Buyerclass[v]))
|
|
|
+ buyerclass = append(buyerclass, fmt.Sprint(P.PushMapping.Buyerclass[v]))
|
|
|
}
|
|
|
if len(buyerclass) == 1 {
|
|
|
buyerclass = append(buyerclass, "9999")
|
|
@@ -468,7 +469,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
if spqp.Subtype != "" {
|
|
|
subtype := []string{}
|
|
|
for _, v := range strings.Split(spqp.Subtype, ",") {
|
|
|
- subtype = append(subtype, fmt.Sprintf("find_in_set('%d',a.subscopeclass)", IC.PushMapping.Subscopeclass[v]))
|
|
|
+ subtype = append(subtype, fmt.Sprintf("find_in_set('%d',a.subscopeclass)", P.PushMapping.Subscopeclass[v]))
|
|
|
}
|
|
|
if len(subtype) == 1 {
|
|
|
subtype = append(subtype, "9999")
|
|
@@ -481,7 +482,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
if spqp.Subscopeclass != "" {
|
|
|
find_in_set := []string{}
|
|
|
for _, v := range strings.Split(spqp.Subscopeclass, ",") {
|
|
|
- find_in_set = append(find_in_set, fmt.Sprintf("find_in_set('%d',a.subscopeclass)", IC.PushMapping.Subscopeclass[v]))
|
|
|
+ find_in_set = append(find_in_set, fmt.Sprintf("find_in_set('%d',a.subscopeclass)", P.PushMapping.Subscopeclass[v]))
|
|
|
}
|
|
|
if len(find_in_set) == 1 {
|
|
|
querys = append(querys, find_in_set[0])
|
|
@@ -908,19 +909,19 @@ func (s *subscribePush) SetRead(newUserId, id int64, userId, entUserId, entId st
|
|
|
}
|
|
|
if isEnt {
|
|
|
if s.ModuleFlag == EntnicheFlag {
|
|
|
- IC.PushMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1 ,visittime=now() where entid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), entId, id)
|
|
|
+ IC.BaseServiceMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1 ,visittime=now() where entid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), entId, id)
|
|
|
|
|
|
} else {
|
|
|
- IC.PushMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1 where entid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), entId, id)
|
|
|
+ IC.BaseServiceMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1 where entid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), entId, id)
|
|
|
|
|
|
}
|
|
|
} else {
|
|
|
if s.ModuleFlag == EntnicheFlag {
|
|
|
//商机管理
|
|
|
- IC.PushMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1,visittime=now() where userid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), entUserId, id)
|
|
|
+ IC.BaseServiceMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1,visittime=now() where userid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), entUserId, id)
|
|
|
} else {
|
|
|
//其他
|
|
|
- IC.PushMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1 where userid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), newUserId, id)
|
|
|
+ IC.BaseServiceMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1 where userid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), newUserId, id)
|
|
|
}
|
|
|
}
|
|
|
if !isEnt {
|