|
@@ -61,12 +61,14 @@ type CompanyUser struct {
|
|
|
IsChartPermissionSetting int `description:"是否设置过图表权限, 0-未设置,1-已设置,2-无需设置"`
|
|
|
YbProductViewTotal int `description:"研报分产品阅读统计"`
|
|
|
IsSubscribe int `description:"是否关注了微信公众号: 0-未关注; 1-已关注"`
|
|
|
+ IsFollow int `description:"是否特别关注: 0-未关注; 1-已关注"`
|
|
|
IsSubscribeHzyj int `description:"是否关注了弘则研究微信公众号: 0-未关注; 1-已关注"`
|
|
|
IsSubscribeCygx int `description:"是否关注了查研观向微信公众号: 0-未关注; 1-已关注"`
|
|
|
FiccViewTotal int `description:"ficc报告的阅读次数" json:"-"`
|
|
|
FiccLastViewTime time.Time `description:"ficc报告最近一次阅读时间" json:"-"`
|
|
|
RaiViewTotal int `description:"权益报告的阅读次数" json:"-"`
|
|
|
RaiLastViewTime time.Time `description:"权益报告的最近一次阅读时间" json:"-"`
|
|
|
+ NotRead bool `description:"是否七天内未阅读"`
|
|
|
}
|
|
|
|
|
|
type CompanyUserListResp struct {
|
|
@@ -138,7 +140,8 @@ func GetCompanyUserListV2(condition string, pars []interface{}, companyId, start
|
|
|
if condition != "" {
|
|
|
sql += condition
|
|
|
}
|
|
|
- sql += ` group by a.user_id ORDER BY a.is_register desc,a.report_last_view_time desc,a.last_updated_time DESC LIMIT ?,? `
|
|
|
+ //sql += ` group by a.user_id ORDER BY a.is_register desc,a.report_last_view_time desc,a.last_updated_time DESC LIMIT ?,? `
|
|
|
+ sql += ` group by a.user_id ORDER BY CASE WHEN is_follow = 1 AND (report_last_view_time < NOW() - INTERVAL 7 DAY or report_last_view_time is NULL ) THEN 0 ELSE 1 END,a.is_register desc,a.report_last_view_time ASC,a.last_updated_time ASC LIMIT ?,? `
|
|
|
_, err = o.Raw(sql, companyId, pars, startSize, pageSize).QueryRows(&items)
|
|
|
return
|
|
|
}
|