feat:完善项目信息

This commit is contained in:
henry
2022-01-11 10:41:46 +08:00
parent 6712feec35
commit 7cab0fb354
24 changed files with 188 additions and 169 deletions

View File

@ -17,12 +17,13 @@ type ServiceInnovateInfo struct {
Title string `json:"title"`
TenantName string `json:"tenant_name"`
KindTitle string `json:"kind_title"`
Sort int `json:"sort"`
CreatedAt time.Time `json:"created_at"`
}
func (m *ServiceInnovate) Innovate(page, pageSize int, count *int64, where ...*model.ModelWhere) ([]*ServiceInnovateInfo, error) {
db := orm.GetDB().Table(m.TableName()+" AS i").
Select("i.id", "i.title", "t.name AS tenant_name", "k.title AS kind_title", "i.created_at",
Select("i.id", "i.title", "t.name AS tenant_name", "k.title AS kind_title", "i.sort", "i.created_at",
"t.province", "t.city").
Joins(fmt.Sprintf("LEFT JOIN %s AS t ON i.tenant_id = t.id", model.NewSysTenant().TableName())).
Joins(fmt.Sprintf("LEFT JOIN %s AS k ON i.kind = k.id", model.NewServiceInnovateKind().TableName())).