feat:完善项目信息
This commit is contained in:
@ -21,15 +21,15 @@ type ExpertHandle func(session *session.Admin) *Expert
|
||||
type (
|
||||
// ExpertInstance 专家信息
|
||||
ExpertInstance struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Industrys []string `json:"industrys"`
|
||||
ResearchName string `json:"research_name"`
|
||||
LaboratoryName string `json:"laboratory_name"`
|
||||
Address string `json:"address"`
|
||||
ExamineStatus model2.ExamineStatusKind `json:"examine_status"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
Area string `json:"area"`
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Industrys []string `json:"industrys"`
|
||||
ResearchName string `json:"research_name"`
|
||||
LaboratoryName string `json:"laboratory_name"`
|
||||
Address string `json:"address"`
|
||||
model2.Examine
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
Area string `json:"area"`
|
||||
}
|
||||
// ExpertDetail 专家详细信息
|
||||
ExpertDetail struct {
|
||||
@ -73,12 +73,12 @@ func (c *Expert) Instance(tenantID uint64, name string, examineStatus int, page,
|
||||
for _, v := range out {
|
||||
_industrys := make([]string, 0)
|
||||
|
||||
for _, v := range mManageExpert.GetIndustryAttribute() {
|
||||
for _, v := range v.GetIndustryAttribute() {
|
||||
_industrys = append(_industrys, config.GetIndustryInfo(v, "-", "/").Value)
|
||||
}
|
||||
// 研究机构,实验室
|
||||
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{
|
||||
Province: v.TenantProvince,
|
||||
City: v.TenantCity,
|
||||
@ -173,6 +173,7 @@ func (c *Expert) Form(params *BasicParams, other *config.IdentityForExpert) erro
|
||||
// 查询手机号码是否在当前租户下是否已经注册了
|
||||
mManageExpert.Name = params.Name
|
||||
mManageExpert.Mobile = params.Mobile
|
||||
mManageExpert.ExamineStatus = model2.ExamineStatusForOngoing
|
||||
|
||||
if isExist, err := params.isExist(mManageExpert.ManageExpert, model2.NewWhere("tenant_id", params.TenantID),
|
||||
model2.NewWhere("mobile", params.Mobile)); err != nil {
|
||||
|
@ -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())).
|
||||
|
Reference in New Issue
Block a user