gin-example/pkg/infrastructure/model/common.go

13 lines
266 B
Go
Raw Normal View History

2023-09-14 06:49:47 +00:00
package model
func SelectByUserId(id int) Account {
var obj Account
DB.Model(&Account{}).Find(&obj,id)
return obj
}
func SelectByAccountNumber(phone string) Account {
var obj Account
DB.Model(&Account{}).Where(&Account{TelNum: phone}).Find(&obj)
return obj
}