Fix Search by ID (#1592)
torrent_id is a column from both torrents and scrapes tables. So you have to specify for which table you want to filter torrent_id. Fix #1589
Cette révision appartient à :
Parent
33e90093b7
révision
d7d737d48b
|
@ -21,7 +21,7 @@ type SortField struct {
|
|||
}
|
||||
|
||||
var sortFields = []SortField{
|
||||
{"id", "torrent_id"},
|
||||
{"id", "torrents.torrent_id"},
|
||||
{"name.raw", "torrent_name"},
|
||||
{"date", "date"},
|
||||
{"downloads", "downloads"},
|
||||
|
|
|
@ -387,11 +387,11 @@ func (p *TorrentParam) toDBQuery(c *gin.Context) *Query {
|
|||
}
|
||||
|
||||
if p.FromID != 0 {
|
||||
query.Append("torrent_id > ?", p.FromID)
|
||||
query.Append("torrents.torrent_id > ?", p.FromID)
|
||||
}
|
||||
if len(p.TorrentID) > 0 {
|
||||
for _, id := range p.TorrentID {
|
||||
query.Append("torrent_id = ?", id)
|
||||
query.Append("torrents.torrent_id = ?", id)
|
||||
}
|
||||
}
|
||||
if p.FromDate != "" {
|
||||
|
|
Référencer dans un nouveau ticket