feat:完善信息
This commit is contained in:
@ -22,8 +22,10 @@ type (
|
||||
ResearchInstance struct {
|
||||
ID string `json:"id"`
|
||||
*model.ManageResearchInfo
|
||||
Address string `json:"address"`
|
||||
Area string `json:"area"`
|
||||
Industrys []string `json:"industrys"`
|
||||
Researchs []string `json:"researchs"`
|
||||
Address string `json:"address"`
|
||||
Area string `json:"area"`
|
||||
}
|
||||
// ResearchSelect 科研机构筛选信息
|
||||
ResearchSelect struct {
|
||||
@ -69,9 +71,19 @@ func (c *Research) Instance(tenantID uint64, name string, examineStatus, page, p
|
||||
list := make([]*ResearchInstance, 0)
|
||||
|
||||
for _, v := range out {
|
||||
mManageResearch.Industry = v.Industry
|
||||
mManageResearch.ManageResearch.Research = v.Research
|
||||
|
||||
_industrys := make([]string, 0)
|
||||
|
||||
for _, v := range mManageResearch.GetIndustryAttribute() {
|
||||
_industrys = append(_industrys, config.GetIndustryInfo(v, "-", ">").Value)
|
||||
}
|
||||
list = append(list, &ResearchInstance{
|
||||
ID: v.GetEncodeID(), ManageResearchInfo: v,
|
||||
Address: v.FormatBasic(), Area: (&model2.Area{
|
||||
Industrys: _industrys,
|
||||
Researchs: mManageResearch.GetResearchAttribute(),
|
||||
Address: v.FormatBasic(), Area: (&model2.Area{
|
||||
Province: v.TenantProvince,
|
||||
City: v.TenantCity,
|
||||
}).FormatBasic(),
|
||||
@ -174,7 +186,7 @@ func (c *Research) Detail(id uint64) (*ResearchDetail, error) {
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if out.ManageResearch == nil {
|
||||
} else if out == nil {
|
||||
return nil, errors.New("操作错误,科研机构信息不存在或已被删除")
|
||||
}
|
||||
_industrys := make([]*config.Industry, 0)
|
||||
@ -187,7 +199,7 @@ func (c *Research) Detail(id uint64) (*ResearchDetail, error) {
|
||||
|
||||
return &ResearchDetail{
|
||||
ID: out.GetEncodeID(), TenantID: out.GetEncodeTenantID(),
|
||||
ManageResearch: out.ManageResearch, Industrys: _industrys,
|
||||
ManageResearch: out, Industrys: _industrys,
|
||||
Keywords: out.GetKeywordAttribute(), Researchs: out.GetResearchAttribute(),
|
||||
}, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user