|
@@ -686,12 +686,14 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
for _, v := range topType {
|
|
|
toptype = append(toptype, P.BidCodeMapping.Toptype[v])
|
|
|
}
|
|
|
- if len(subtype) == 1 {
|
|
|
+ if len(topType) == 1 {
|
|
|
toptype = append(toptype, "9999")
|
|
|
}
|
|
|
} else {
|
|
|
for _, v := range stype {
|
|
|
- subtype = append(subtype, P.BidCodeMapping.Subtype[v])
|
|
|
+ if P.BidCodeMapping.Subtype[v] != "" {
|
|
|
+ subtype = append(subtype, P.BidCodeMapping.Subtype[v])
|
|
|
+ }
|
|
|
}
|
|
|
if len(subtype) == 1 {
|
|
|
subtype = append(subtype, "9999")
|
|
@@ -703,10 +705,13 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
toptype = append(toptype, "9999")
|
|
|
}
|
|
|
}
|
|
|
- if len(subtype) > 0 {
|
|
|
+ if len(subtype) > 0 && len(toptype) > 0 {
|
|
|
+ s1 := fmt.Sprintf("(%s or %s)", fmt.Sprintf("a.subtype in (%s)", strings.Join(subtype, ",")),
|
|
|
+ fmt.Sprintf("a.toptype in (%s)", strings.Join(toptype, ",")))
|
|
|
+ querys = append(querys, s1)
|
|
|
+ } else if len(subtype) > 0 {
|
|
|
querys = append(querys, fmt.Sprintf("a.subtype in (%s)", strings.Join(subtype, ",")))
|
|
|
- }
|
|
|
- if len(toptype) > 0 {
|
|
|
+ } else if len(toptype) > 0 {
|
|
|
querys = append(querys, fmt.Sprintf("a.toptype in (%s)", strings.Join(toptype, ",")))
|
|
|
}
|
|
|
}
|
|
@@ -966,7 +971,6 @@ func getDetail(Mgo_bidding mongodb.MongodbSim, bidding, bidding_back string, sub
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-//
|
|
|
func getInfosByIds(Mgo_bidding mongodb.MongodbSim, bidding, bidding_back string, isDetail bool, ids []string) map[string]map[string]interface{} {
|
|
|
infos := map[string]map[string]interface{}{}
|
|
|
//redis
|