mirror of
https://github.com/gogf/gf.git
synced 2025-04-05 11:18:50 +08:00
25 lines
468 B
Go
25 lines
468 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
)
|
|
|
|
func main() {
|
|
g.Config().SetFileName("config3.toml")
|
|
if r, err := g.DB().Model("user").Where("uid=?", 1).One(); err == nil {
|
|
fmt.Println(r["uid"].Int())
|
|
fmt.Println(r["name"].String())
|
|
} else {
|
|
fmt.Println(err)
|
|
}
|
|
|
|
if r, err := g.DB("user").Model("user").Where("uid=?", 1).One(); err == nil {
|
|
fmt.Println(r["uid"].Int())
|
|
fmt.Println(r["name"].String())
|
|
} else {
|
|
fmt.Println(err)
|
|
}
|
|
}
|