1
0
mirror of https://github.com/gogf/gf.git synced 2025-04-05 11:18:50 +08:00
gf/.example/database/gdb/mysql/gdb_update_union.go
2021-10-11 21:41:56 +08:00

18 lines
317 B
Go

package main
import (
"fmt"
"github.com/gogf/gf/v2/frame/g"
)
func main() {
db := g.DB()
db.SetDebug(true)
result, err := db.Model("pw_passageway m,pw_template t").Data("t.status", 99).Where("m.templateId=t.id AND m.status = 0").Update()
if err != nil {
panic(err)
}
fmt.Println(result.RowsAffected())
}