From 32b3c443f641cd3bbf11aaa81545581a1cd38038 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 1 May 2018 11:03:53 +0800 Subject: [PATCH] README updates --- README.MD | 3 ++- geg/other/test.go | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.MD b/README.MD index 13209ee1a..90363e678 100644 --- a/README.MD +++ b/README.MD @@ -61,7 +61,8 @@ gf是一款模块化、松耦合、轻量级、高性能的Web开发框架。开 * [基本语法](http://gf.johng.cn/591643) * [基本函数](http://gf.johng.cn/591644) * [数据库ORM](http://gf.johng.cn/494380) - * [数据库配置](http://gf.johng.cn/596222) + * [ORM基本介绍](http://gf.johng.cn/606753) + * [ORM使用配置](http://gf.johng.cn/596222) * [ORM链式操作](http://gf.johng.cn/596224) * [ORM方法操作](http://gf.johng.cn/596223) * [ORM事务操作](http://gf.johng.cn/596225) diff --git a/geg/other/test.go b/geg/other/test.go index f5616886a..b61068517 100644 --- a/geg/other/test.go +++ b/geg/other/test.go @@ -2,15 +2,18 @@ package main import ( "fmt" - "gitee.com/johng/gf/g/os/gtime" - "gitee.com/johng/gf/g/util/gconv" - "time" - "reflect" + "gitee.com/johng/gf/g" + "gitee.com/johng/gf/g/os/glog" ) func main() { - - fmt.Println(reflect.TypeOf(gconv.Time(gtime.Second()))) - fmt.Println(time.Unix(gtime.Second(), 0).String()) - + g.Config().SetPath("/home/john/Workspace/Go/GOPATH/src/gitee.com/johng/gf/geg/frame") + db := g.Database() + if r, err := db.Table("goods").Where("id=?", 1).One(); err == nil { + fmt.Printf("goods id: %d\n", r["id"].Int()) + fmt.Printf("goods title: %s\n", r["title"].String()) + fmt.Printf("goods proce: %.2f\n", r["price"].Float32()) + } else { + glog.Error(err) + } } \ No newline at end of file