1
This commit is contained in:
@@ -271,6 +271,14 @@ func (r *QuestionDao) GetQuestionPageSearch(req requests.GetQuestionPage, page,
|
||||
query = query.Order("discount_price " + req.Order.DiscountPrice)
|
||||
}
|
||||
|
||||
if req.Order.CreatedAt != "" {
|
||||
if req.Order.CreatedAt != "desc" && req.Order.CreatedAt != "asc" {
|
||||
return nil, 0, errors.New("排序字段错误")
|
||||
}
|
||||
|
||||
query = query.Order("created_at " + req.Order.CreatedAt)
|
||||
}
|
||||
|
||||
if req.Order.UpdatedAt != "" {
|
||||
if req.Order.UpdatedAt != "desc" && req.Order.UpdatedAt != "asc" {
|
||||
return nil, 0, errors.New("排序字段错误")
|
||||
|
||||
Reference in New Issue
Block a user