mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-10-12 04:53:47 +08:00
发布v2.8.4版本,更新内容请查看:https://github.com/bufanyun/hotgo/tree/v2.0/docs/guide-zh-CN/addon-version-upgrade.md
This commit is contained in:
25
server/internal/model/input/form/select.go
Normal file
25
server/internal/model/input/form/select.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package form
|
||||
|
||||
import "github.com/gogf/gf/v2/util/gconv"
|
||||
|
||||
// Selects 选项
|
||||
type Selects []*Select
|
||||
|
||||
type Select struct {
|
||||
Value interface{} `json:"value"`
|
||||
Label string `json:"label"`
|
||||
Name string `json:"name"`
|
||||
Disabled bool `json:"disabled"`
|
||||
}
|
||||
|
||||
func (p Selects) Len() int {
|
||||
return len(p)
|
||||
}
|
||||
|
||||
func (p Selects) Swap(i, j int) {
|
||||
p[i], p[j] = p[j], p[i]
|
||||
}
|
||||
|
||||
func (p Selects) Less(i, j int) bool {
|
||||
return gconv.Int64(p[j].Value) > gconv.Int64(p[i].Value)
|
||||
}
|
Reference in New Issue
Block a user