|
@@ -474,7 +474,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
subtype = append(subtype, "9999")
|
|
|
}
|
|
|
if len(subtype) > 0 {
|
|
|
- querys = append(querys, fmt.Sprintf("b.subtype_code in (%s)", strings.Join(subtype, ",")))
|
|
|
+ querys = append(querys, fmt.Sprintf("a.subtype_code in (%s)", strings.Join(subtype, ",")))
|
|
|
}
|
|
|
}
|
|
|
//信息行业
|
|
@@ -566,7 +566,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
//查询数量(需要去重)
|
|
|
countSql = fmt.Sprintf("select count(1) from %s a where %s %s %s", aboutDbMsg[s.ModuleFlag].MysqlTable, strings.Join(querys, " and "), userStr, common.If(isNew, " and a.source = 2 ", ""))
|
|
|
//列表查询
|
|
|
- findSql = fmt.Sprintf("select a.id,a.infoid,a.matchkeys,b.isvalidfile as attachment_count from %s a where %s %s %s order by a.date desc,a.id desc",
|
|
|
+ findSql = fmt.Sprintf("select a.id,a.infoid,a.matchkeys,a.attachment_count from %s a where %s %s %s order by a.date desc,a.id desc",
|
|
|
aboutDbMsg[s.ModuleFlag].MysqlTable, userStr, common.If(isNew, " and a.source = 2 ", ""))
|
|
|
} else {
|
|
|
//查询分配人员或是否已读
|
|
@@ -583,7 +583,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
|
|
|
}
|
|
|
countSql = fmt.Sprintf("select count(1) from %s a s where %s %s %s and ((%s) or EXISTS (SELECT 1 from %s c WHERE c.source=3 %s and %s and a.id=c.pid and (%s))) ", aboutDbMsg[s.ModuleFlag].MysqlTable, strings.Join(querys, " and "), userStr, common.If(isNew, " and a.source = 2 ", ""), staffQuery, aboutDbMsg[s.ModuleFlag].MysqlTable, strings.ReplaceAll(userStr, "a.", "c."), strings.Join(querys, " and "), strings.ReplaceAll(staffQuery, "a.", "c."))
|
|
|
//列表查询
|
|
|
- findSql = fmt.Sprintf("select a.id,a.infoid,a.matchkeys,b.isvalidfile as attachment_count from %s a where %s %s %s and ((%s) or EXISTS (SELECT 1 from %s c WHERE c.source=3 %s and %s and a.id=c.pid and (%s))) order by a.date desc,a.id desc ", aboutDbMsg[s.ModuleFlag].MysqlTable, strings.Join(querys, " and "), userStr, common.If(isNew, " and a.source = 2 ", ""), staffQuery, aboutDbMsg[s.ModuleFlag].MysqlTable, strings.ReplaceAll(userStr, "a.", "c."), strings.Join(querys, " and "), strings.ReplaceAll(staffQuery, "a.", "c."))
|
|
|
+ findSql = fmt.Sprintf("select a.id,a.infoid,a.matchkeys,a.attachment_count from %s a where %s %s %s and ((%s) or EXISTS (SELECT 1 from %s c WHERE c.source=3 %s and %s and a.id=c.pid and (%s))) order by a.date desc,a.id desc ", aboutDbMsg[s.ModuleFlag].MysqlTable, strings.Join(querys, " and "), userStr, common.If(isNew, " and a.source = 2 ", ""), staffQuery, aboutDbMsg[s.ModuleFlag].MysqlTable, strings.ReplaceAll(userStr, "a.", "c."), strings.Join(querys, " and "), strings.ReplaceAll(staffQuery, "a.", "c."))
|
|
|
}
|
|
|
} else {
|
|
|
// 是否已读
|