Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

category and status search not workign

Cette révision appartient à :
ayame-git 2017-05-09 05:29:26 +03:00
Parent 0c3f72f9a2
révision 711dc5fda0

Voir le fichier

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