Init project with vote module
This commit is contained in:
commit
98f3c2aedc
11 changed files with 671 additions and 0 deletions
11
models/users.go
Normal file
11
models/users.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
package models
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func (u *User) GetPlans(orm *gorm.DB) ([]Plan, error) {
|
||||
var plans []Plan
|
||||
err := orm.Model(u).Association("MemberPlans").Find(&plans)
|
||||
return plans, err
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue