Fix Pluck's usage #4473

This commit is contained in:
wuwenchi 2021-06-26 21:23:16 +08:00
parent 8e67a08774
commit 8bd8d38fe9
1 changed files with 1 additions and 1 deletions

View File

@ -474,7 +474,7 @@ func (db *DB) Scan(dest interface{}) (tx *DB) {
// Pluck used to query single column from a model as a map // Pluck used to query single column from a model as a map
// var ages []int64 // var ages []int64
// db.Find(&users).Pluck("age", &ages) // db.Model(&users).Pluck("age", &ages)
func (db *DB) Pluck(column string, dest interface{}) (tx *DB) { func (db *DB) Pluck(column string, dest interface{}) (tx *DB) {
tx = db.getInstance() tx = db.getInstance()
if tx.Statement.Model != nil { if tx.Statement.Model != nil {