Bug fix
This commit is contained in:
parent
8d41caf40a
commit
0a14545a19
@ -43,8 +43,8 @@ func (db *DB) GetArticleAuthors(c *Config, articleID int64) ([]*User, error) {
|
||||
query := `
|
||||
SELECT u.id
|
||||
FROM articles a
|
||||
INNER JOIN articles_tags at ON a.id = at.article_id
|
||||
INNER JOIN users u ON at.author_id = u.id
|
||||
INNER JOIN articles_authors aa ON a.id = aa.article_id
|
||||
INNER JOIN users u ON aa.author_id = u.id
|
||||
WHERE a.id = ?
|
||||
`
|
||||
rows, err := db.Query(query, articleID)
|
||||
|
@ -43,8 +43,8 @@ func (db *DB) GetArticleContributors(c *Config, articleID int64) ([]*User, error
|
||||
query := `
|
||||
SELECT u.id
|
||||
FROM articles a
|
||||
INNER JOIN articles_tags at ON a.id = at.article_id
|
||||
INNER JOIN users u ON at.contributor_id = u.id
|
||||
INNER JOIN articles_contributors ac ON a.id = ac.article_id
|
||||
INNER JOIN users u ON ac.contributor_id = u.id
|
||||
WHERE a.id = ?
|
||||
`
|
||||
rows, err := db.Query(query, articleID)
|
||||
|
@ -43,8 +43,8 @@ func (db *DB) GetArticleTags(articleID int64) ([]*Tag, error) {
|
||||
query := `
|
||||
SELECT t.id, t.name
|
||||
FROM articles a
|
||||
INNER JOIN articles_tags at ON a.id = at.article_id
|
||||
INNER JOIN tags t ON at.tag_id = t.id
|
||||
INNER JOIN articles_tags at ON a.id = at.article_id
|
||||
INNER JOIN tags t ON at.tag_id = t.id
|
||||
WHERE a.id = ?
|
||||
`
|
||||
rows, err := db.Query(query, articleID)
|
||||
|
Loading…
x
Reference in New Issue
Block a user