Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Cette révision appartient à :
ayame-git 2017-05-09 05:44:08 +03:00
Parent c15ec0c551
révision 59b1e2bb5f
2 fichiers modifiés avec 20 ajouts et 20 suppressions

Voir le fichier

@ -23,9 +23,9 @@ type Torrents struct {
Id uint `gorm:"column:torrent_id;primary_key"`
Name string `gorm:"column:torrent_name"`
Hash string `gorm:"column:torrent_hash"`
Category int `gorm:"column:category"`
Sub_Category int `gorm:"column:sub_category"`
Status int `gorm:"column:status"`
Category int `gorm:"column:category_od"`
Sub_Category int `gorm:"column:sub_category_id"`
Status int `gorm:"column:status_id"`
Date time.Time `gorm:"column:date"`
UploaderId uint `gorm:"column:uploader"`
Downloads int `gorm:"column:downloads"`

Voir le fichier

@ -79,11 +79,11 @@ func SearchByQuery(r *http.Request, pagenum int) (SearchParam, []model.Torrents,
parameters := torrentService.WhereParams{}
conditions := []string{}
if searchCatId != "" {
conditions = append(conditions, "category = ?")
conditions = append(conditions, "category_id = ?")
parameters.Params = append(parameters.Params, searchCatId)
}
if searchSubCatId != "" {
conditions = append(conditions, "sub_category = ?")
conditions = append(conditions, "sub_category_id = ?")
parameters.Params = append(parameters.Params, searchSubCatId)
}
if userId != "" {
@ -92,9 +92,9 @@ func SearchByQuery(r *http.Request, pagenum int) (SearchParam, []model.Torrents,
}
if search_param.Status != "" {
if search_param.Status == "2" {
conditions = append(conditions, "status != ?")
conditions = append(conditions, "status_id != ?")
} else {
conditions = append(conditions, "status = ?")
conditions = append(conditions, "status_id = ?")
}
parameters.Params = append(parameters.Params, search_param.Status)
}