feat:优化项目信息
This commit is contained in:
@ -3,10 +3,8 @@ package identity
|
||||
import (
|
||||
"SciencesServer/app/api/enterprise/model"
|
||||
"SciencesServer/app/api/manage/controller"
|
||||
"SciencesServer/app/basic/config"
|
||||
model2 "SciencesServer/app/common/model"
|
||||
"SciencesServer/app/session"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type Instance struct {
|
||||
@ -19,15 +17,14 @@ type InstanceHandle func(session *session.Enterprise, local string) *Instance
|
||||
type (
|
||||
// InstanceForExpert 专家信息
|
||||
InstanceForExpert struct {
|
||||
*model.UserManageForExpert
|
||||
ID string `json:"id"`
|
||||
Industry string `json:"industry"`
|
||||
ID string `json:"id"`
|
||||
*model.UserIdentityForExpert
|
||||
}
|
||||
)
|
||||
|
||||
// Expert 专家列表
|
||||
func (c *Instance) Expert(name, mobile string, page, pageSize int) (*controller.ReturnPages, error) {
|
||||
mUserManage := model.NewUserManage()
|
||||
mUserIdentity := model.NewUserIdentity()
|
||||
|
||||
where := make([]*model2.ModelWhere, 0)
|
||||
|
||||
@ -39,7 +36,7 @@ func (c *Instance) Expert(name, mobile string, page, pageSize int) (*controller.
|
||||
}
|
||||
var count int64
|
||||
|
||||
out, err := mUserManage.Expert(page, pageSize, &count, where...)
|
||||
out, err := mUserIdentity.Expert(page, pageSize, &count, where...)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -48,16 +45,10 @@ func (c *Instance) Expert(name, mobile string, page, pageSize int) (*controller.
|
||||
list := make([]*InstanceForExpert, 0)
|
||||
|
||||
for _, v := range out {
|
||||
mUserManage.ID = v.ID
|
||||
mUserManage.IdentityInfo = v.IdentityInfo
|
||||
obj := mUserManage.GetIdentityInfoAttribute().(*model2.UserIdentityForExpert)
|
||||
industry := make([]string, 0)
|
||||
mUserIdentity.ID = v.ID
|
||||
|
||||
for _, v := range strings.Split(obj.Industry, ";") {
|
||||
industry = append(industry, config.GetIndustryInfo(v, "-"))
|
||||
}
|
||||
list = append(list, &InstanceForExpert{
|
||||
UserManageForExpert: v, ID: mUserManage.GetEncodeID(), Industry: strings.Join(industry, ";"),
|
||||
ID: mUserIdentity.GetEncodeID(), UserIdentityForExpert: v,
|
||||
})
|
||||
}
|
||||
return &controller.ReturnPages{Data: list, Count: count}, nil
|
||||
|
Reference in New Issue
Block a user