This commit is contained in:
@@ -249,6 +249,13 @@ func (s *Store) readDashboard(ctx context.Context, q dobotaiops.RecordQuery, mas
|
||||
out.Regions = append(out.Regions, r)
|
||||
}
|
||||
inPeriod := 0
|
||||
regionFrom := out.MonthStart
|
||||
if q.Granularity != "" {
|
||||
// 区域统计跟随所选区间:按天/周/月/自定义看板里,"这个区间用了多少"才是
|
||||
// 用户要的数字。老周看板(granularity 为空)保持原来的自然月累计不变,
|
||||
// 周报生成链路逐字段不变。分母仍是月度通讯录人数,由前端注明快照月份。
|
||||
regionFrom = q.Window.Start
|
||||
}
|
||||
for _, r := range records {
|
||||
if q.Granularity == "" {
|
||||
if !r.at.Before(out.WeekStart) {
|
||||
@@ -269,7 +276,7 @@ func (s *Store) readDashboard(ctx context.Context, q dobotaiops.RecordQuery, mas
|
||||
products[dashboardCategory(v.Effective.ProductCategory)]++
|
||||
types[dashboardCategory(v.Effective.ProblemType)]++
|
||||
}
|
||||
if !r.at.Before(out.MonthStart) {
|
||||
if !r.at.Before(regionFrom) {
|
||||
person := attribution.Resolve(r.identity.StaffID, r.identity.UnionID, r.fields["asker"], r.fields["trigger_person"])
|
||||
if index, ok := regionIndex[person.Region]; ok && person.PersonID != "" {
|
||||
out.Regions[index].Questions++
|
||||
|
||||
Reference in New Issue
Block a user