gorm执行sql
gorm执行sql
type Object interface {
GroupOrderOpenlog() (uidList []int)
}
func (o *object) GroupOrderOpenlog() {
type res struct {
Uid int `json:"uid"`
}
var re []res
sql:= "SELECT uid FROM order_openlog GROUP BY uid"
o.Db.Raw(sql).Scan(&re)
fmt.Println(re)
for _,k :=range re{
fmt.Println(k.Uid)
}
}
选择了IT,必定终身学习