|
@@ -306,6 +306,10 @@ 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 := " "
|
|
|
+<<<<<<< HEAD
|
|
|
+=======
|
|
|
+ leftJoinStr := " "
|
|
|
+>>>>>>> feature/v1.1.5
|
|
|
var (
|
|
|
searchSql, findSql string
|
|
|
)
|
|
@@ -318,10 +322,16 @@ 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 {
|
|
|
+<<<<<<< HEAD
|
|
|
userStr = fmt.Sprintf(" and a.entid='%s'", spqp.EntId)
|
|
|
} else {
|
|
|
userStr = fmt.Sprintf(" and a.userid='%s'", common.If(s.ModuleFlag == "eType", spqp.EntUserId, common.InterfaceToStr(spqp.NewUserId)))
|
|
|
|
|
|
+=======
|
|
|
+ userStr = 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)))
|
|
|
+>>>>>>> feature/v1.1.5
|
|
|
}
|
|
|
codeMap, err := IC.CodeLib.CodeTransformation(context.Background(), &codeservice.Request{})
|
|
|
if codeMap.Data == nil || err != nil {
|
|
@@ -421,10 +431,8 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- if len(find_in_set) == 1 {
|
|
|
- find_in_set = append(find_in_set, "9999")
|
|
|
- }
|
|
|
if len(find_in_set) > 0 {
|
|
|
+ leftJoinStr = fmt.Sprintf(" INNER JOIN %s t on t.infoid = b.infoid and t.labelcode=2 ", BidTags)
|
|
|
querys = append(querys, fmt.Sprintf(" t.labelvalues in (%s)", strings.Join(find_in_set, ",")))
|
|
|
}
|
|
|
}
|
|
@@ -461,8 +469,13 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
querys = append(querys, fmt.Sprintf("b.isvalidfile =0 "))
|
|
|
}
|
|
|
}
|
|
|
+<<<<<<< HEAD
|
|
|
searchSql = fmt.Sprintf(" from %s a LEFT JOIN %s b ON a.infoid = b.infoid %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 INNER JOIN %s b ON %s and a.infoid = b.infoid %s where %s"+
|
|
|
+ " order by a.id desc", aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, userStr, leftJoinStr, strings.Join(querys, " and "))
|
|
|
+>>>>>>> feature/v1.1.5
|
|
|
logx.Info("searchSql", searchSql)
|
|
|
//查询总数
|
|
|
logx.Info(fmt.Sprintf("select count(a.id) " + searchSql))
|