forked from ebhomengo/niki
1
0
Fork 0
niki/pkg/query_builder/mysql/sort.go

15 lines
269 B
Go
Raw Normal View History

package mysqlquerybuilder
import (
"fmt"
"git.gocasts.ir/ebhomengo/niki/param"
)
func BuildSortQuery(sort param.SortRequest) string {
if sort.Field == "" && sort.Direction == "" {
return ""
}
return fmt.Sprintf("ORDER BY %s %s", sort.Field, sort.Direction)
}