diff --git a/app/api/enterprise/controller/settled/research.go b/app/api/enterprise/controller/settled/research.go index 1cf76ff..d8a8f9c 100644 --- a/app/api/enterprise/controller/settled/research.go +++ b/app/api/enterprise/controller/settled/research.go @@ -59,6 +59,7 @@ func (c *Research) Launch(params *BasicParams, other *config.IdentityForResearch mManageResearch.SetIndustryAttribute(params.Industrys) mManageResearch.SetKeywordAttribute(params.Keywords) mManageResearch.SetResearchAttribute(other.Researchs) + mManageResearch.License = other.FilterLicense() mManageResearch.Introduce = params.Introduce return orm.GetDB().Transaction(func(tx *gorm.DB) error { diff --git a/app/basic/config/public.go b/app/basic/config/public.go index c750d21..0f14892 100644 --- a/app/basic/config/public.go +++ b/app/basic/config/public.go @@ -1,6 +1,10 @@ package config -import "SciencesServer/utils" +import ( + "SciencesServer/config" + "SciencesServer/utils" + "strings" +) // Area 区域 type Area struct { @@ -33,9 +37,10 @@ type ( } // IdentityForResearch 研究机构 IdentityForResearch struct { - Longitude float64 `json:"longitude" form:"longitude"` // 经度 - Latitude float64 `json:"latitude" form:"latitude"` // 纬度 - Researchs []string `json:"researchs" form:"researchs"` // 研究方向 + Longitude float64 `json:"longitude" form:"longitude"` // 经度 + Latitude float64 `json:"latitude" form:"latitude"` // 纬度 + License string `json:"license" form:"license" binding:"required"` // 营业执照 + Researchs []string `json:"researchs" form:"researchs"` // 研究方向 } // IdentityForLaboratory 实验室 IdentityForLaboratory struct { @@ -63,6 +68,10 @@ type ( } ) +func (this *IdentityForCompany) FilterLicense() string { + return strings.Replace(this.License, config.SystemConfig[config.SysImageDomain], "", -1) +} + func (this *IdentityForExpert) ConvertResearch() uint64 { if this.ResearchID == "" { return 0 @@ -77,6 +86,10 @@ func (this *IdentityForExpert) ConvertLaboratory() uint64 { return uint64(utils.HASHIDDecode(this.LaboratoryID)) } +func (this *IdentityForResearch) FilterLicense() string { + return strings.Replace(this.License, config.SystemConfig[config.SysImageDomain], "", -1) +} + func (this *IdentityForLaboratory) ConvertResearch() uint64 { if this.ResearchID == "" { return 0 diff --git a/app/common/model/manage_research.go b/app/common/model/manage_research.go index 9d26428..36da0b1 100644 --- a/app/common/model/manage_research.go +++ b/app/common/model/manage_research.go @@ -15,6 +15,7 @@ type ManageResearch struct { Position string `gorm:"column:position;type:varchar(50);default:'';comment:坐标" json:"-"` Industry string `gorm:"column:industry;type:varchar(255);default:'';comment:所属领域;行业信息" json:"-"` Keyword string `gorm:"column:keyword;type:varchar(255);default:'';comment:关键词" json:"keyword"` + License string `gorm:"column:license;type:varchar(255);default:'';comment:营业执照" json:"license"` Research string `gorm:"column:research;type:varchar(255);default:'';comment:研究信息" json:"research"` Introduce string `gorm:"column:introduce;type:text;comment:介绍描述" json:"introduce"` Examine