|
@@ -305,7 +305,6 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total
|
|
|
|
|
|
func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, endtime int64, size int, isLimit bool) (result []*bxsubscribe.SubscribeInfo, count int64) {
|
|
|
querys := []string{}
|
|
|
- userStr := ""
|
|
|
var (
|
|
|
searchSql, findSql string
|
|
|
)
|
|
@@ -317,9 +316,9 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
findSql = "select a.id,a.date,a.infoid,a.isvisit,a.matchkeys,a.type,b.isvalidfile as attachment_count"
|
|
|
} else {
|
|
|
if spqp.IsEnt {
|
|
|
- userStr = fmt.Sprintf(" a.entid='%s'", spqp.EntId)
|
|
|
+ querys = []string{fmt.Sprintf("a.entid='%s'", spqp.EntId)}
|
|
|
} else {
|
|
|
- userStr = fmt.Sprintf(" a.userid='%s'", common.If(s.ModuleFlag == "eType", spqp.EntUserId, common.InterfaceToStr(spqp.NewUserId)))
|
|
|
+ querys = []string{fmt.Sprintf("a.userid='%s'", common.If(s.ModuleFlag == "eType", spqp.EntUserId, common.InterfaceToStr(spqp.NewUserId)))}
|
|
|
|
|
|
}
|
|
|
codeMap, err := IC.CodeLib.CodeTransformation(context.Background(), &codeservice.Request{})
|
|
@@ -460,14 +459,13 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
querys = append(querys, fmt.Sprintf("b.isvalidfile =0 "))
|
|
|
}
|
|
|
}
|
|
|
- searchSql = fmt.Sprintf(" from %s a LEFT JOIN %s b ON a.infoid = b.infoid and %s LEFT JOIN %s t on t.infoid = b.infoid and t.labelcode=2 where %s"+
|
|
|
- " order by a.id desc", aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, userStr, BidTags, strings.Join(querys, " and "))
|
|
|
+ searchSql = fmt.Sprintf(" from %s a LEFT JOIN %s b ON a.infoid = b.infoid LEFT JOIN %s t on t.infoid = b.infoid and t.labelcode=2 where %s"+
|
|
|
+ " order by a.id desc", aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, BidTags, strings.Join(querys, " and "))
|
|
|
logx.Info("searchSql", searchSql)
|
|
|
//查询总数
|
|
|
logx.Info(fmt.Sprintf("select count(a.id) " + searchSql))
|
|
|
//count = spqp.BaseServiceMysql.CountBySql(fmt.Sprintf("select count(a.id) " + searchSql))
|
|
|
- count = 0
|
|
|
- logx.Info("count:", count, "---", s.ModuleFlag)
|
|
|
+ //logx.Info("count:", count, "---", s.ModuleFlag)
|
|
|
findSql = "select a.id,a.date,a.infoid,a.isvisit,a.matchkeys,a.type,b.isvalidfile as attachment_count"
|
|
|
}
|
|
|
if s.ModuleFlag != MemberFlag && s.ModuleFlag != EntnicheFlag {
|
|
@@ -480,8 +478,8 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
logx.Info("findSql", findSql)
|
|
|
logx.Info(spqp.NewUserId, "subscribePush query sql:", findSql)
|
|
|
list := spqp.BaseServiceMysql.SelectBySql(findSql)
|
|
|
- //logx.Info("数据库数据", list)
|
|
|
if list != nil && len(*list) > 0 {
|
|
|
+ logx.Info("数据库数据", list)
|
|
|
pushCas := s.GetJyPushs(*list)
|
|
|
if !spqp.Export {
|
|
|
result = s.GetInfoByIds(spqp.Mgo_bidding, spqp.Bidding, spqp.Bidding_back, pushCas)
|