gf/.example/database/gdb/mysql/gdb_update_union.go

18 lines
314 B
Go

package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
)
func main() {
db := g.DB()
db.SetDebug(true)
result, err := db.Table("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())
}