|
|
@ -1661,14 +1661,14 @@ func GetUserIssueStats(opts UserIssueStatsOptions) (*IssueStats, error) {
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case FilterModeAssign:
|
|
|
|
case FilterModeAssign:
|
|
|
|
stats.OpenCount, err = x.Where(cond).And("is_closed = ?", false).
|
|
|
|
stats.OpenCount, err = x.Where(cond).And("issue.is_closed = ?", false).
|
|
|
|
Join("INNER", "issue_assignees", "issue.id = issue_assignees.issue_id").
|
|
|
|
Join("INNER", "issue_assignees", "issue.id = issue_assignees.issue_id").
|
|
|
|
And("issue_assignees.assignee_id = ?", opts.UserID).
|
|
|
|
And("issue_assignees.assignee_id = ?", opts.UserID).
|
|
|
|
Count(new(Issue))
|
|
|
|
Count(new(Issue))
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stats.ClosedCount, err = x.Where(cond).And("is_closed = ?", true).
|
|
|
|
stats.ClosedCount, err = x.Where(cond).And("issue.is_closed = ?", true).
|
|
|
|
Join("INNER", "issue_assignees", "issue.id = issue_assignees.issue_id").
|
|
|
|
Join("INNER", "issue_assignees", "issue.id = issue_assignees.issue_id").
|
|
|
|
And("issue_assignees.assignee_id = ?", opts.UserID).
|
|
|
|
And("issue_assignees.assignee_id = ?", opts.UserID).
|
|
|
|
Count(new(Issue))
|
|
|
|
Count(new(Issue))
|
|
|
@ -1689,14 +1689,14 @@ func GetUserIssueStats(opts UserIssueStatsOptions) (*IssueStats, error) {
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case FilterModeMention:
|
|
|
|
case FilterModeMention:
|
|
|
|
stats.OpenCount, err = x.Where(cond).And("is_closed = ?", false).
|
|
|
|
stats.OpenCount, err = x.Where(cond).And("issue.is_closed = ?", false).
|
|
|
|
Join("INNER", "issue_user", "issue.id = issue_user.issue_id and issue_user.is_mentioned = ?", true).
|
|
|
|
Join("INNER", "issue_user", "issue.id = issue_user.issue_id and issue_user.is_mentioned = ?", true).
|
|
|
|
And("issue_user.uid = ?", opts.UserID).
|
|
|
|
And("issue_user.uid = ?", opts.UserID).
|
|
|
|
Count(new(Issue))
|
|
|
|
Count(new(Issue))
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stats.ClosedCount, err = x.Where(cond).And("is_closed = ?", true).
|
|
|
|
stats.ClosedCount, err = x.Where(cond).And("issue.is_closed = ?", true).
|
|
|
|
Join("INNER", "issue_user", "issue.id = issue_user.issue_id and issue_user.is_mentioned = ?", true).
|
|
|
|
Join("INNER", "issue_user", "issue.id = issue_user.issue_id and issue_user.is_mentioned = ?", true).
|
|
|
|
And("issue_user.uid = ?", opts.UserID).
|
|
|
|
And("issue_user.uid = ?", opts.UserID).
|
|
|
|
Count(new(Issue))
|
|
|
|
Count(new(Issue))
|
|
|
|