forked from ebhomengo/niki
15 lines
269 B
Go
15 lines
269 B
Go
|
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)
|
||
|
}
|