feat:完善项目信息

This commit is contained in:
henry
2022-01-20 10:03:38 +08:00
parent 2d628a9dfa
commit bbbfab5b4d
2 changed files with 13 additions and 13 deletions

View File

@ -17,7 +17,6 @@ type (
Name string `json:"name"`
ResearchName string `json:"research_name"`
LaboratoryName string `json:"laboratory_name"`
model.Area
TenantProvince string `json:"-"`
TenantCity string `json:"-"`
}
@ -47,7 +46,7 @@ func (m *ManageExpert) Expert(id uint64) (*ManageExpertDetail, error) {
func (m *ManageExpert) Experts(page, pageSize int, count *int64, where ...*model.ModelWhere) ([]*ManageExpertInfo, error) {
db := orm.GetDB().Table(m.TableName()+" AS e").
Select("e.id", "e.name", "e.industry", "r.name AS research_name", "l.name AS laboratory_name",
"e.province", "e.city", "e.created_at",
"e.province", "e.city", "e.created_at", "e.examine_status", "e.examine_at",
"t.province AS tenant_province", "t.city AS tenant_city").
Joins(fmt.Sprintf("LEFT JOIN %s AS r ON e.research_id = r.id", model.NewManageResearch().TableName())).
Joins(fmt.Sprintf("LEFT JOIN %s AS l ON e.laboratory_id = l.id", model.NewManageLaboratory().TableName())).