category and status search not workign
Cette révision appartient à :
Parent
0c3f72f9a2
révision
711dc5fda0
1 fichiers modifiés avec 4 ajouts et 4 suppressions
|
@ -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)
|
||||
}
|
||||
|
|
Référencer dans un nouveau ticket