feat:完善项目信息
This commit is contained in:
@ -1,27 +0,0 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"SciencesServer/app/common/model"
|
||||
"SciencesServer/serve/orm"
|
||||
)
|
||||
|
||||
type SysPlatform struct {
|
||||
*model.SysPlatform
|
||||
}
|
||||
|
||||
// Platform 平台信息
|
||||
func (m *SysPlatform) Platform() ([]*model.SysPlatform, error) {
|
||||
out := make([]*model.SysPlatform, 0)
|
||||
|
||||
err := orm.GetDB().Table(m.TableName()).
|
||||
Select("id", "parent_id", "`key`", "`code`", "title", "link").
|
||||
Where("is_deleted = ?", model.DeleteStatusForNot).
|
||||
Order("sort " + model.OrderModeToDesc).
|
||||
Scan(&out).Error
|
||||
|
||||
return out, err
|
||||
}
|
||||
|
||||
func NewSysPlatform() *SysPlatform {
|
||||
return &SysPlatform{model.NewSysPlatform()}
|
||||
}
|
27
app/api/website/model/sys_tenant.go
Normal file
27
app/api/website/model/sys_tenant.go
Normal file
@ -0,0 +1,27 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"SciencesServer/app/common/model"
|
||||
"SciencesServer/serve/orm"
|
||||
)
|
||||
|
||||
type SysTenant struct {
|
||||
*model.SysTenant
|
||||
}
|
||||
|
||||
// Tenant 租户平台信息
|
||||
func (m *SysTenant) Tenant() ([]*model.SysTenant, error) {
|
||||
out := make([]*model.SysTenant, 0)
|
||||
|
||||
err := orm.GetDB().Table(m.TableName()).
|
||||
Select("id", "`key`", "name", "domain", "province", "city").
|
||||
Where("is_deleted = ?", model.DeleteStatusForNot).
|
||||
Order("province " + model.OrderModeToAsc).Order("city " + model.OrderModeToAsc).
|
||||
Scan(&out).Error
|
||||
|
||||
return out, err
|
||||
}
|
||||
|
||||
func NewSysTenant() *SysTenant {
|
||||
return &SysTenant{model.NewSysTenant()}
|
||||
}
|
Reference in New Issue
Block a user