|
|
|
@ -1682,6 +1682,21 @@ func GetUserIssueStats(opts UserIssueStatsOptions) (*IssueStats, error) { |
|
|
|
|
if err != nil { |
|
|
|
|
return nil, err |
|
|
|
|
} |
|
|
|
|
case FilterModeMention: |
|
|
|
|
stats.OpenCount, err = x.Where(cond).And("is_closed = ?", false). |
|
|
|
|
Join("INNER", "issue_user", "issue.id = issue_user.issue_id and issue_user.is_mentioned = ?", true). |
|
|
|
|
And("issue_user.uid = ?", opts.UserID). |
|
|
|
|
Count(new(Issue)) |
|
|
|
|
if err != nil { |
|
|
|
|
return nil, err |
|
|
|
|
} |
|
|
|
|
stats.ClosedCount, err = x.Where(cond).And("is_closed = ?", true). |
|
|
|
|
Join("INNER", "issue_user", "issue.id = issue_user.issue_id and issue_user.is_mentioned = ?", true). |
|
|
|
|
And("issue_user.uid = ?", opts.UserID). |
|
|
|
|
Count(new(Issue)) |
|
|
|
|
if err != nil { |
|
|
|
|
return nil, err |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cond = cond.And(builder.Eq{"issue.is_closed": opts.IsClosed}) |
|
|
|
@ -1700,6 +1715,14 @@ func GetUserIssueStats(opts UserIssueStatsOptions) (*IssueStats, error) { |
|
|
|
|
return nil, err |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
stats.MentionCount, err = x.Where(cond). |
|
|
|
|
Join("INNER", "issue_user", "issue.id = issue_user.issue_id and issue_user.is_mentioned = ?", true). |
|
|
|
|
And("issue_user.uid = ?", opts.UserID). |
|
|
|
|
Count(new(Issue)) |
|
|
|
|
if err != nil { |
|
|
|
|
return nil, err |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
stats.YourRepositoriesCount, err = x.Where(cond). |
|
|
|
|
And(builder.In("issue.repo_id", opts.UserRepoIDs)). |
|
|
|
|
Count(new(Issue)) |
|
|
|
|