16 lines
359 B
Go
16 lines
359 B
Go
package gmodel
|
|
|
|
import "context"
|
|
|
|
// TODO: 使用model的属性做你想做的
|
|
|
|
// 获取全部菜单
|
|
func (d *LdapMenusModel) GetAll(ctx context.Context) (resp []LdapMenus, err error) {
|
|
var menus []LdapMenus
|
|
result := d.db.Model(&LdapMenus{}).Where("status = ?", 1).Find(&menus)
|
|
if result.Error != nil {
|
|
return nil, result.Error
|
|
}
|
|
return menus, nil
|
|
}
|