mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-03-15 00:22:44 +01:00
save query to work later with it or not ...
This commit is contained in:
parent
b180c3bb3d
commit
783df3c298
1 changed files with 6 additions and 0 deletions
|
@ -63,6 +63,7 @@ func GetIssueWatchers(issueID int64) ([]*IssueWatch, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getIssueWatchers(e Engine, issueID int64) (watches []*IssueWatch, err error) {
|
func getIssueWatchers(e Engine, issueID int64) (watches []*IssueWatch, err error) {
|
||||||
|
// handle manual watchers
|
||||||
err = e.
|
err = e.
|
||||||
Where("`issue_watch`.issue_id = ?", issueID).
|
Where("`issue_watch`.issue_id = ?", issueID).
|
||||||
And("`issue_watch`.is_watching > ?", 0).
|
And("`issue_watch`.is_watching > ?", 0).
|
||||||
|
@ -70,6 +71,11 @@ func getIssueWatchers(e Engine, issueID int64) (watches []*IssueWatch, err error
|
||||||
And("`user`.prohibit_login = ?", false).
|
And("`user`.prohibit_login = ?", false).
|
||||||
Join("INNER", "`user`", "`user`.id = `issue_watch`.user_id").
|
Join("INNER", "`user`", "`user`.id = `issue_watch`.user_id").
|
||||||
Find(&watches)
|
Find(&watches)
|
||||||
|
// handle default watchers (repowatchers)
|
||||||
|
// SELECT x.user_id as repowatchers FROM (SELECT watch.user_id FROM issue,watch WHERE issue.repo_id = watch.repo_id AND issue.id = 71) as x LEFT JOIN (SELECT user_id FROM issue_watch WHERE is_watching = 0) as y ON x.user_id = y.user_id WHERE y.user_id IS NULL;
|
||||||
|
// returns list of userIDs
|
||||||
|
|
||||||
|
//watches = append(watches)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue