feat:完善信息
This commit is contained in:
@ -1,7 +1,9 @@
|
||||
package identity
|
||||
|
||||
import (
|
||||
"SciencesServer/app/api/enterprise/model"
|
||||
"SciencesServer/app/api/manage/controller"
|
||||
model2 "SciencesServer/app/common/model"
|
||||
"SciencesServer/app/service"
|
||||
)
|
||||
|
||||
@ -12,12 +14,46 @@ type Instance struct {
|
||||
|
||||
type InstanceHandle func(enterprise *service.SessionEnterprise, local string) *Instance
|
||||
|
||||
type (
|
||||
// InstanceForExpert 专家信息
|
||||
InstanceForExpert struct {
|
||||
*model.UserManageForExpert
|
||||
ID string `json:"id"`
|
||||
}
|
||||
)
|
||||
|
||||
// Expert 专家列表
|
||||
func (c *Instance) Expert(name, mobile string, page, pageSize int) (*controller.ReturnPages, error) {
|
||||
return nil, nil
|
||||
mUserManage := model.NewUserManage()
|
||||
|
||||
where := make([]*model2.ModelWhere, 0)
|
||||
|
||||
if name != "" {
|
||||
where = append(where, model2.NewWhereLike("m.name", name))
|
||||
}
|
||||
if mobile != "" {
|
||||
where = append(where, model2.NewWhereLike("u.mobile", mobile))
|
||||
}
|
||||
var count int64
|
||||
|
||||
out, err := mUserManage.Expert(page, pageSize, &count, where...)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
list := make([]*InstanceForExpert, 0)
|
||||
|
||||
for _, v := range out {
|
||||
mUserManage.ID = v.ID
|
||||
list = append(list, &InstanceForExpert{
|
||||
UserManageForExpert: v, ID: mUserManage.GetEncodeID(),
|
||||
})
|
||||
}
|
||||
return &controller.ReturnPages{Data: list, Count: count}, nil
|
||||
}
|
||||
|
||||
func NewIdentity() InstanceHandle {
|
||||
func NewInstance() InstanceHandle {
|
||||
return func(enterprise *service.SessionEnterprise, local string) *Instance {
|
||||
return &Instance{
|
||||
SessionEnterprise: enterprise,
|
||||
|
Reference in New Issue
Block a user