|
@@ -98,6 +98,7 @@ type SubPushQueryParam struct {
|
|
Source string //信息来源
|
|
Source string //信息来源
|
|
Staffs []string //分发人员
|
|
Staffs []string //分发人员
|
|
BaseServiceMysql *mysql.Mysql
|
|
BaseServiceMysql *mysql.Mysql
|
|
|
|
+ PushMysql *mysql.Mysql
|
|
NewUserId int64
|
|
NewUserId int64
|
|
IsEnt bool
|
|
IsEnt bool
|
|
SelectInfoIds []string
|
|
SelectInfoIds []string
|
|
@@ -392,7 +393,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
logx.Info("countSql", countSql)
|
|
logx.Info("countSql", countSql)
|
|
findSql = fmt.Sprintf("select id,date,infoid,isvisit,matchkeys,type,attachment_count from %s where %s order by a.date desc,a.id desc", aboutDbMsg[s.ModuleFlag].MysqlTable, fmt.Sprintf("a.id in ('%s')", strings.Join(spqp.SelectInfoIds, "','")))
|
|
findSql = fmt.Sprintf("select id,date,infoid,isvisit,matchkeys,type,attachment_count from %s where %s order by a.date desc,a.id desc", aboutDbMsg[s.ModuleFlag].MysqlTable, fmt.Sprintf("a.id in ('%s')", strings.Join(spqp.SelectInfoIds, "','")))
|
|
//查询总数
|
|
//查询总数
|
|
- count = spqp.BaseServiceMysql.CountBySql(countSql)
|
|
|
|
|
|
+ count = spqp.PushMysql.CountBySql(countSql)
|
|
} else {
|
|
} else {
|
|
//公共查询条件
|
|
//公共查询条件
|
|
//时间
|
|
//时间
|
|
@@ -631,13 +632,13 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
}
|
|
}
|
|
//查询总数
|
|
//查询总数
|
|
logx.Info("countSql", countSql)
|
|
logx.Info("countSql", countSql)
|
|
- count = spqp.BaseServiceMysql.CountBySql(countSql)
|
|
|
|
|
|
+ count = spqp.PushMysql.CountBySql(countSql)
|
|
}
|
|
}
|
|
if isLimit {
|
|
if isLimit {
|
|
findSql += fmt.Sprintf(" limit %d,%d", (spqp.PageNum-1)*size, size)
|
|
findSql += fmt.Sprintf(" limit %d,%d", (spqp.PageNum-1)*size, size)
|
|
}
|
|
}
|
|
logx.Info(spqp.NewUserId, "subscribePush query sql:", findSql)
|
|
logx.Info(spqp.NewUserId, "subscribePush query sql:", findSql)
|
|
- list := spqp.BaseServiceMysql.SelectBySql(findSql)
|
|
|
|
|
|
+ list := spqp.PushMysql.SelectBySql(findSql)
|
|
if list != nil && len(*list) > 0 {
|
|
if list != nil && len(*list) > 0 {
|
|
pushCas := s.GetJyPushs(*list)
|
|
pushCas := s.GetJyPushs(*list)
|
|
if !spqp.Export {
|
|
if !spqp.Export {
|
|
@@ -906,19 +907,19 @@ func (s *subscribePush) SetRead(newUserId, id int64, userId, entUserId, entId st
|
|
}
|
|
}
|
|
if isEnt {
|
|
if isEnt {
|
|
if s.ModuleFlag == EntnicheFlag {
|
|
if s.ModuleFlag == EntnicheFlag {
|
|
- IC.BaseServiceMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1 ,visittime=now() where entid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), entId, id)
|
|
|
|
|
|
+ IC.PushMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1 ,visittime=now() where entid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), entId, id)
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- IC.BaseServiceMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1 where entid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), entId, id)
|
|
|
|
|
|
+ IC.PushMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1 where entid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), entId, id)
|
|
|
|
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
if s.ModuleFlag == EntnicheFlag {
|
|
if s.ModuleFlag == EntnicheFlag {
|
|
//商机管理
|
|
//商机管理
|
|
- IC.BaseServiceMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1,visittime=now() where userid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), entUserId, id)
|
|
|
|
|
|
+ IC.PushMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1,visittime=now() where userid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), entUserId, id)
|
|
} else {
|
|
} else {
|
|
//其他
|
|
//其他
|
|
- IC.BaseServiceMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1 where userid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), newUserId, id)
|
|
|
|
|
|
+ IC.PushMysql.UpdateOrDeleteBySql(fmt.Sprintf("update %s set isvisit=1 where userid=? and id=?", aboutDbMsg[s.ModuleFlag].MysqlTable), newUserId, id)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if !isEnt {
|
|
if !isEnt {
|
|
@@ -1124,11 +1125,11 @@ func (s *subscribePush) listManager(spqp *SubPushQueryParam, list []map[string]i
|
|
id := int64(0)
|
|
id := int64(0)
|
|
switch s.ModuleFlag {
|
|
switch s.ModuleFlag {
|
|
case EntnicheFlag:
|
|
case EntnicheFlag:
|
|
- _, id = spqp.BaseServiceMysql.InsertIgnoreBatch(aboutDbMsg[s.ModuleFlag].MysqlTable, ennicheInsertCollKey, pushInsert)
|
|
|
|
|
|
+ _, id = spqp.PushMysql.InsertIgnoreBatch(aboutDbMsg[s.ModuleFlag].MysqlTable, ennicheInsertCollKey, pushInsert)
|
|
case MemberFlag:
|
|
case MemberFlag:
|
|
- _, id = spqp.BaseServiceMysql.InsertIgnoreBatch(aboutDbMsg[s.ModuleFlag].MysqlTable, memberInsertCollKey, pushInsert)
|
|
|
|
|
|
+ _, id = spqp.PushMysql.InsertIgnoreBatch(aboutDbMsg[s.ModuleFlag].MysqlTable, memberInsertCollKey, pushInsert)
|
|
default:
|
|
default:
|
|
- _, id = spqp.BaseServiceMysql.InsertIgnoreBatch(aboutDbMsg[s.ModuleFlag].MysqlTable, subscribeInsertCollKey, pushInsert)
|
|
|
|
|
|
+ _, id = spqp.PushMysql.InsertIgnoreBatch(aboutDbMsg[s.ModuleFlag].MysqlTable, subscribeInsertCollKey, pushInsert)
|
|
}
|
|
}
|
|
for i := length - 1; i >= 0; i-- {
|
|
for i := length - 1; i >= 0; i-- {
|
|
resultList[i].CaIndex = id
|
|
resultList[i].CaIndex = id
|