修改排序

This commit is contained in:
yangduo 2024-07-25 19:03:15 +08:00
parent 1b00034511
commit d2410ae07f

View File

@ -119,19 +119,19 @@ func (ea *EventApi) ActivityQuery(c *gin.Context) {
q5.AppendSlice(&subFilters, f5.GetDbFilter().Custom(inSub).And())
}
}
orderBy := ""
{
for _, val := range reqJson.Sort.Fields {
if val.Name == "price" && orderBy == "" {
t := q5.SafeToInt32(val.Type)
if t < 0 {
orderBy = " ORDER BY price_len DESC, price DESC"
} else {
orderBy = " ORDER BY price_len ASC, price ASC"
}
}
}
}
orderBy := " ORDER BY createtime DESC "
// {
// for _, val := range reqJson.Sort.Fields {
// if val.Name == "price" && orderBy == "" {
// t := q5.SafeToInt32(val.Type)
// if t < 0 {
// orderBy = " ORDER BY price_len DESC, price DESC"
// } else {
// orderBy = " ORDER BY price_len ASC, price ASC"
// }
// }
// }
// }
rspObj := struct {
ErrCode int32 `json:"errcode"`