gin-example/pkg/infrastructure/model/common.go
2023-09-14 14:49:47 +08:00

13 lines
266 B
Go

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
}