feat:完善项目信息

This commit is contained in:
henry
2022-01-11 17:40:08 +08:00
parent 58dc5fd6c9
commit 0d49575e06
3 changed files with 37 additions and 16 deletions

View File

@ -4,6 +4,7 @@ import (
"SciencesServer/app/common/model"
"SciencesServer/serve/orm"
"fmt"
"time"
)
type ServiceInnovateKind struct {
@ -12,14 +13,16 @@ type ServiceInnovateKind struct {
type ServiceInnovateKindInfo struct {
model.Model
model.ModelTenant
model.Area
Title string `json:"title"`
Title string `json:"title"`
CreatedAt time.Time `json:"created_at"`
}
// Kind 分类信息
func (m *ServiceInnovateKind) Kind(page, pageSize int, count *int64, where ...*model.ModelWhere) ([]*ServiceInnovateKindInfo, error) {
db := orm.GetDB().Table(m.TableName()+" AS k").
Select("k.id", "i.title", "k.created_at", "t.province", "t.city").
Select("k.id", "k.tenant_id", "k.title", "k.created_at", "t.province", "t.city").
Joins(fmt.Sprintf("LEFT JOIN %s AS t ON k.tenant_id = t.id", model.NewSysTenant().TableName())).
Where("k.is_deleted = ?", model.DeleteStatusForNot)