|
@@ -305,6 +305,7 @@ 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) {
|
|
func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, endtime int64, size int, isLimit bool) (result []*bxsubscribe.SubscribeInfo, count int64) {
|
|
querys := []string{}
|
|
querys := []string{}
|
|
userStr := " "
|
|
userStr := " "
|
|
|
|
+ leftJoinStr := " "
|
|
var (
|
|
var (
|
|
searchSql, findSql string
|
|
searchSql, findSql string
|
|
)
|
|
)
|
|
@@ -419,10 +420,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 {
|
|
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, ",")))
|
|
querys = append(querys, fmt.Sprintf(" t.labelvalues in (%s)", strings.Join(find_in_set, ",")))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -459,8 +458,8 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
querys = append(querys, fmt.Sprintf("b.isvalidfile =0 "))
|
|
querys = append(querys, fmt.Sprintf("b.isvalidfile =0 "))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- searchSql = fmt.Sprintf(" from %s a INNER JOIN %s b ON %s and a.infoid = b.infoid INNER 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 "))
|
|
logx.Info("searchSql", searchSql)
|
|
logx.Info("searchSql", searchSql)
|
|
//查询总数
|
|
//查询总数
|
|
logx.Info(fmt.Sprintf("select count(a.id) " + searchSql))
|
|
logx.Info(fmt.Sprintf("select count(a.id) " + searchSql))
|