Fix sukebei fromID search (#1722)
* Update sortmode.go * Update torrentParam.go
Cette révision appartient à :
Parent
213780f0eb
révision
1bbda2c96a
|
@ -21,7 +21,7 @@ type SortField struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
var sortFields = []SortField{
|
var sortFields = []SortField{
|
||||||
{"id", "torrents.torrent_id"},
|
{"id", config.Get().Models.TorrentsTableName + ".torrent_id"},
|
||||||
{"name.raw", "torrent_name"},
|
{"name.raw", "torrent_name"},
|
||||||
{"date", "date"},
|
{"date", "date"},
|
||||||
{"downloads", "downloads"},
|
{"downloads", "downloads"},
|
||||||
|
|
|
@ -13,6 +13,7 @@ import (
|
||||||
|
|
||||||
elastic "gopkg.in/olivere/elastic.v5"
|
elastic "gopkg.in/olivere/elastic.v5"
|
||||||
|
|
||||||
|
"github.com/NyaaPantsu/nyaa/config"
|
||||||
"github.com/NyaaPantsu/nyaa/models"
|
"github.com/NyaaPantsu/nyaa/models"
|
||||||
"github.com/NyaaPantsu/nyaa/models/torrents"
|
"github.com/NyaaPantsu/nyaa/models/torrents"
|
||||||
"github.com/NyaaPantsu/nyaa/utils/log"
|
"github.com/NyaaPantsu/nyaa/utils/log"
|
||||||
|
@ -390,11 +391,11 @@ func (p *TorrentParam) toDBQuery(c *gin.Context) *Query {
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.FromID != 0 {
|
if p.FromID != 0 {
|
||||||
query.Append("torrents.torrent_id > ?", p.FromID)
|
query.Append(config.Get().Models.TorrentsTableName + ".torrent_id > ?", p.FromID)
|
||||||
}
|
}
|
||||||
if len(p.TorrentID) > 0 {
|
if len(p.TorrentID) > 0 {
|
||||||
for _, id := range p.TorrentID {
|
for _, id := range p.TorrentID {
|
||||||
query.Append("torrents.torrent_id = ?", id)
|
query.Append(config.Get().Models.TorrentsTableName + ".torrent_id = ?", id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if p.FromDate != "" {
|
if p.FromDate != "" {
|
||||||
|
|
Référencer dans un nouveau ticket