Bug fixed for issues (#156)
This commit is contained in:
parent
54e6ed3431
commit
3dedc027ac
1 changed files with 6 additions and 14 deletions
|
@ -820,20 +820,12 @@ func Issues(opts *IssuesOptions) ([]*Issue, error) {
|
||||||
sess := x.Limit(setting.UI.IssuePagingNum, (opts.Page-1)*setting.UI.IssuePagingNum)
|
sess := x.Limit(setting.UI.IssuePagingNum, (opts.Page-1)*setting.UI.IssuePagingNum)
|
||||||
|
|
||||||
if opts.RepoID > 0 {
|
if opts.RepoID > 0 {
|
||||||
sess.
|
sess.And("issue.repo_id=?", opts.RepoID)
|
||||||
Where("issue.repo_id=?", opts.RepoID).
|
} else if len(opts.RepoIDs) > 0 {
|
||||||
And("issue.is_closed=?", opts.IsClosed)
|
|
||||||
} else if opts.RepoIDs != nil {
|
|
||||||
// In case repository IDs are provided but actually no repository has issue.
|
// In case repository IDs are provided but actually no repository has issue.
|
||||||
if len(opts.RepoIDs) == 0 {
|
sess.In("issue.repo_id", opts.RepoIDs)
|
||||||
return make([]*Issue, 0), nil
|
|
||||||
}
|
|
||||||
sess.
|
|
||||||
In("issue.repo_id", opts.RepoIDs).
|
|
||||||
And("issue.is_closed=?", opts.IsClosed)
|
|
||||||
} else {
|
|
||||||
sess.Where("issue.is_closed=?", opts.IsClosed)
|
|
||||||
}
|
}
|
||||||
|
sess.And("issue.is_closed=?", opts.IsClosed)
|
||||||
|
|
||||||
if opts.AssigneeID > 0 {
|
if opts.AssigneeID > 0 {
|
||||||
sess.And("issue.assignee_id=?", opts.AssigneeID)
|
sess.And("issue.assignee_id=?", opts.AssigneeID)
|
||||||
|
@ -1185,9 +1177,9 @@ func GetUserIssueStats(repoID, uid int64, repoIDs []int64, filterMode int, isPul
|
||||||
Where("issue.is_closed = ?", isClosed).
|
Where("issue.is_closed = ?", isClosed).
|
||||||
And("issue.is_pull = ?", isPull)
|
And("issue.is_pull = ?", isPull)
|
||||||
|
|
||||||
if repoID > 0 || len(repoIDs) == 0 {
|
if repoID > 0 {
|
||||||
sess.And("repo_id = ?", repoID)
|
sess.And("repo_id = ?", repoID)
|
||||||
} else {
|
} else if len(repoIDs) > 0 {
|
||||||
sess.In("repo_id", repoIDs)
|
sess.In("repo_id", repoIDs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue