|
@@ -846,12 +846,16 @@ func (this *EntFollow) DelLabelGroup(groupId string) error {
|
|
|
func (this *EntFollow) GetFollowGroupList() (groupUserArr []EntFollowGroup, err error) {
|
|
|
groupMap := make(map[int]int)
|
|
|
DefaultGroupInit(this.UserId)
|
|
|
- flistSql := fmt.Sprintf(`SELECT m.s_entId,g.id as groupId from follow_ent_monitor m inner join follow_ent_monitor_group g on(m.s_userid =g.s_userid and g.s_userid ='%s') INNER JOIN follow_ent_monitor_relationship r on ( g.id=r.s_groupId and m.s_entId=r.s_entId ) GROUP BY s_entId ORDER BY m.l_lastpushtime DESC,m.l_createtime DESC LIMIT %d,%d`, this.UserId, 0, this.MaxNum)
|
|
|
+ flistSql := fmt.Sprintf(`SELECT m.s_entId,GROUP_CONCAT(g.id SEPARATOR ',') as gs from follow_ent_monitor m inner join follow_ent_monitor_group g on(m.s_userid =g.s_userid and g.s_userid ='%s') INNER JOIN follow_ent_monitor_relationship r on ( g.id=r.s_groupId and m.s_entId=r.s_entId ) GROUP BY s_entId ORDER BY m.l_lastpushtime DESC,m.l_createtime DESC LIMIT %d,%d`, this.UserId, 0, this.MaxNum)
|
|
|
log.Print("我关注的企业列表开始查询:", flistSql)
|
|
|
res := db.Base.SelectBySql(flistSql)
|
|
|
if res != nil && len(*res) > 0 {
|
|
|
for _, m := range *res {
|
|
|
- groupMap[qutil.IntAll(m["groupId"])]++
|
|
|
+ for _, gId := range strings.Split(gconv.String(m["gs"]), ",") {
|
|
|
+ if groupId := gconv.Int(gId); groupId > 0 {
|
|
|
+ groupMap[groupId]++
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
data := db.Base.SelectBySql(fmt.Sprintf(`SELECT
|