完善
This commit is contained in:
parent
ff8ef956ef
commit
a2c593885a
4
main.go
4
main.go
|
@ -19,9 +19,9 @@ func init() {
|
|||
}
|
||||
|
||||
func main() {
|
||||
T, total, err := models.WpPostsM.SimplePagination(nil, "*", 1, 10, models.SqlBuilder{{"ID", "desc"}})
|
||||
T, err := models.WpPostsM.FindOneById(1)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Println(T, total)
|
||||
fmt.Println(T)
|
||||
}
|
||||
|
|
|
@ -15,6 +15,14 @@ type mod interface {
|
|||
type model[T mod] struct {
|
||||
}
|
||||
|
||||
func (m model[T]) PrimaryKey() string {
|
||||
return "id"
|
||||
}
|
||||
|
||||
func (m model[T]) Table() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
type SqlBuilder [][]string
|
||||
|
||||
func (w SqlBuilder) parseWhere() (string, []interface{}) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user