mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-30 10:48:15 +08:00
24 lines
519 B
Go
24 lines
519 B
Go
package dao
|
|
|
|
import (
|
|
"github.com/goodrain/rainbond/db/model"
|
|
"github.com/jinzhu/gorm"
|
|
)
|
|
|
|
//EnterpriseDaoImpl 租户信息管理
|
|
type EnterpriseDaoImpl struct {
|
|
DB *gorm.DB
|
|
}
|
|
|
|
// GetEnterpriseTenants -
|
|
func (e *EnterpriseDaoImpl) GetEnterpriseTenants(enterpriseID string) ([]*model.Tenants, error) {
|
|
var tenants []*model.Tenants
|
|
if enterpriseID == "" {
|
|
return []*model.Tenants{}, nil
|
|
}
|
|
if err := e.DB.Where("eid= ?", enterpriseID).Find(&tenants).Error; err != nil {
|
|
return nil, err
|
|
}
|
|
return tenants, nil
|
|
}
|