Merge pull request #442 from etcinit/docs

Add an example with time
This commit is contained in:
Jinzhu 2015-04-04 20:25:57 +08:00
commit 2123f31d13
1 changed files with 5 additions and 0 deletions

View File

@ -213,6 +213,11 @@ db.Where("name LIKE ?", "%jin%").Find(&users)
// AND // AND
db.Where("name = ? and age >= ?", "jinzhu", "22").Find(&users) db.Where("name = ? and age >= ?", "jinzhu", "22").Find(&users)
// Time
db.Where("updated_at > ?", lastWeek).Find(&users)
db.Where("created_at BETWEEN ? AND ?", lastWeek, today).Find(&users)
``` ```
### Query With Where (Struct & Map) ### Query With Where (Struct & Map)