feat:完善项目信息
This commit is contained in:
@ -27,7 +27,7 @@ type (
|
|||||||
ResearchName string `json:"research_name"`
|
ResearchName string `json:"research_name"`
|
||||||
LaboratoryName string `json:"laboratory_name"`
|
LaboratoryName string `json:"laboratory_name"`
|
||||||
Address string `json:"address"`
|
Address string `json:"address"`
|
||||||
ExamineStatus model2.ExamineStatusKind `json:"examine_status"`
|
model2.Examine
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"created_at"`
|
||||||
Area string `json:"area"`
|
Area string `json:"area"`
|
||||||
}
|
}
|
||||||
@ -73,12 +73,12 @@ func (c *Expert) Instance(tenantID uint64, name string, examineStatus int, page,
|
|||||||
for _, v := range out {
|
for _, v := range out {
|
||||||
_industrys := make([]string, 0)
|
_industrys := make([]string, 0)
|
||||||
|
|
||||||
for _, v := range mManageExpert.GetIndustryAttribute() {
|
for _, v := range v.GetIndustryAttribute() {
|
||||||
_industrys = append(_industrys, config.GetIndustryInfo(v, "-", "/").Value)
|
_industrys = append(_industrys, config.GetIndustryInfo(v, "-", "/").Value)
|
||||||
}
|
}
|
||||||
// 研究机构,实验室
|
// 研究机构,实验室
|
||||||
list = append(list, &ExpertInstance{ID: v.GetEncodeID(), Name: v.Name, Industrys: _industrys,
|
list = append(list, &ExpertInstance{ID: v.GetEncodeID(), Name: v.Name, Industrys: _industrys,
|
||||||
ResearchName: v.ResearchName, LaboratoryName: v.LaboratoryName, ExamineStatus: v.ExamineStatus,
|
ResearchName: v.ResearchName, LaboratoryName: v.LaboratoryName, Examine: v.Examine,
|
||||||
Address: v.FormatBasic(), CreatedAt: v.CreatedAt, Area: (&model2.Area{
|
Address: v.FormatBasic(), CreatedAt: v.CreatedAt, Area: (&model2.Area{
|
||||||
Province: v.TenantProvince,
|
Province: v.TenantProvince,
|
||||||
City: v.TenantCity,
|
City: v.TenantCity,
|
||||||
@ -173,6 +173,7 @@ func (c *Expert) Form(params *BasicParams, other *config.IdentityForExpert) erro
|
|||||||
// 查询手机号码是否在当前租户下是否已经注册了
|
// 查询手机号码是否在当前租户下是否已经注册了
|
||||||
mManageExpert.Name = params.Name
|
mManageExpert.Name = params.Name
|
||||||
mManageExpert.Mobile = params.Mobile
|
mManageExpert.Mobile = params.Mobile
|
||||||
|
mManageExpert.ExamineStatus = model2.ExamineStatusForOngoing
|
||||||
|
|
||||||
if isExist, err := params.isExist(mManageExpert.ManageExpert, model2.NewWhere("tenant_id", params.TenantID),
|
if isExist, err := params.isExist(mManageExpert.ManageExpert, model2.NewWhere("tenant_id", params.TenantID),
|
||||||
model2.NewWhere("mobile", params.Mobile)); err != nil {
|
model2.NewWhere("mobile", params.Mobile)); err != nil {
|
||||||
|
|||||||
@ -17,7 +17,6 @@ type (
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
ResearchName string `json:"research_name"`
|
ResearchName string `json:"research_name"`
|
||||||
LaboratoryName string `json:"laboratory_name"`
|
LaboratoryName string `json:"laboratory_name"`
|
||||||
model.Area
|
|
||||||
TenantProvince string `json:"-"`
|
TenantProvince string `json:"-"`
|
||||||
TenantCity 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) {
|
func (m *ManageExpert) Experts(page, pageSize int, count *int64, where ...*model.ModelWhere) ([]*ManageExpertInfo, error) {
|
||||||
db := orm.GetDB().Table(m.TableName()+" AS e").
|
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",
|
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").
|
"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 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())).
|
Joins(fmt.Sprintf("LEFT JOIN %s AS l ON e.laboratory_id = l.id", model.NewManageLaboratory().TableName())).
|
||||||
|
|||||||
Reference in New Issue
Block a user