feat:完善信息
This commit is contained in:
@ -21,20 +21,22 @@ type ExpertHandle func(session *session.Enterprise) *Expert
|
||||
type (
|
||||
// ExpertBasicInfo 基本信息
|
||||
ExpertBasicInfo struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
School string `json:"school"`
|
||||
Image string `json:"image"`
|
||||
Major string `json:"major"`
|
||||
Industrys []string `json:"industrys"`
|
||||
Keywords []string `json:"keywords"`
|
||||
PatentTitles []string `json:"patent_titles"`
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
School string `json:"school"`
|
||||
Image string `json:"image"`
|
||||
Major string `json:"major"`
|
||||
Industrys []string `json:"industrys"`
|
||||
Keywords []string `json:"keywords"`
|
||||
PatentTitle []string `json:"patent_title"`
|
||||
}
|
||||
// ExpertInstanceInfo 专家信息
|
||||
ExpertInstanceInfo struct {
|
||||
ExpertBasicInfo
|
||||
Researchs []string `json:"researchs"`
|
||||
Introduce string `json:"introduce"`
|
||||
ResearchName string `json:"research_name"`
|
||||
Researchs []string `json:"researchs"`
|
||||
Introduce string `json:"introduce"`
|
||||
Videos []string `json:"videos"`
|
||||
}
|
||||
)
|
||||
|
||||
@ -74,17 +76,18 @@ func (c *Expert) Instance(id uint64) (*ExpertInstanceInfo, error) {
|
||||
}
|
||||
return &ExpertInstanceInfo{
|
||||
ExpertBasicInfo: ExpertBasicInfo{
|
||||
ID: out.GetEncodeID(),
|
||||
Name: out.Name,
|
||||
Image: out.Image.Analysis(config2.SystemConfig[config2.SysImageDomain]),
|
||||
School: out.School,
|
||||
Major: out.Major,
|
||||
Industrys: _industrys,
|
||||
Keywords: out.GetKeywordAttribute(),
|
||||
PatentTitles: patentTitles,
|
||||
ID: out.GetEncodeID(),
|
||||
Name: out.Name,
|
||||
Image: out.Image.Analysis(config2.SystemConfig[config2.SysImageDomain]),
|
||||
School: out.School,
|
||||
Major: out.Major,
|
||||
Industrys: _industrys,
|
||||
Keywords: out.GetKeywordAttribute(),
|
||||
PatentTitle: patentTitles,
|
||||
},
|
||||
Researchs: out.GetResearchAttribute(),
|
||||
Introduce: out.Introduce,
|
||||
ResearchName: out.ResearchName,
|
||||
Researchs: out.GetResearchAttribute(),
|
||||
Introduce: out.Introduce,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@ -69,13 +69,13 @@ func expert(ids []uint64) (interface{}, error) {
|
||||
v.Image.Image = v.Image.Analysis(config2.SystemConfig[config2.SysImageDomain])
|
||||
|
||||
list = append(list, &ExpertBasicInfo{
|
||||
ID: v.GetEncodeID(),
|
||||
Name: v.Name,
|
||||
School: v.School,
|
||||
Major: v.Major,
|
||||
Industrys: v.GetIndustryAttribute(),
|
||||
Keywords: v.GetKeywordAttribute(),
|
||||
PatentTitles: strings.Split(v.PatentTitle, "&&"),
|
||||
ID: v.GetEncodeID(),
|
||||
Name: v.Name,
|
||||
School: v.School,
|
||||
Major: v.Major,
|
||||
Industrys: v.GetIndustryAttribute(),
|
||||
Keywords: v.GetKeywordAttribute(),
|
||||
PatentTitle: strings.Split(v.PatentTitle, "&&"),
|
||||
})
|
||||
}
|
||||
return list, nil
|
||||
|
||||
@ -58,8 +58,8 @@ func (m *ManageExpert) Detail(limit int, id uint64) (*ManageExpertInfo, error) {
|
||||
mUserPatent := model.NewUserPatent()
|
||||
|
||||
db := orm.GetDB().Table(m.TableName()+" AS e").
|
||||
Select("e.id", "e.name", "e.industry", "e.school", "e.major", "e.keyword", "e.research", "e.introduce",
|
||||
"p.title AS patent_title", "r.name AS research_name").
|
||||
Select("e.id", "e.name", "e.industry", "e.image", "e.school", "e.major", "e.keyword", "e.research",
|
||||
"e.introduce", "p.title AS patent_title", "r.name AS research_name").
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS e_u ON e.id = e_u.expert_id AND e_u.invalid_status = %d AND e_u.is_deleted = %d",
|
||||
model.NewUserExpert().TableName(), model.InvalidStatusForNot, model.DeleteStatusForNot)).
|
||||
Joins(fmt.Sprintf(`LEFT JOIN (SELECT u.uid, SUBSTRING_INDEX(GROUP_CONCAT(p.kind, '$$', p.title ORDER BY p.id DESC SEPARATOR '&&'), '&&', %d) AS title
|
||||
|
||||
Reference in New Issue
Block a user