mirror of
https://gitee.com/johng/gf
synced 2026-07-08 06:35:16 +08:00
improve model feature
This commit is contained in:
4
.example/frame/main/model/config.toml
Normal file
4
.example/frame/main/model/config.toml
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
# MySQL数据库配置
|
||||
[database]
|
||||
link = "mysql:root:12345678@tcp(127.0.0.1:3306)/test"
|
||||
15
.example/frame/main/model/model1.go
Normal file
15
.example/frame/main/model/model1.go
Normal file
@ -0,0 +1,15 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/.example/frame/mvc/model/test"
|
||||
"github.com/gogf/gf/frame/g"
|
||||
)
|
||||
|
||||
func main() {
|
||||
g.DB().SetDebug(true)
|
||||
user, err := test.ModelUser().One()
|
||||
g.Dump(err)
|
||||
g.Dump(user)
|
||||
user.Password = "1"
|
||||
g.Dump(user.Update())
|
||||
}
|
||||
Reference in New Issue
Block a user