feat:完善项目管理,增加科研机构下实验室列表信息
This commit is contained in:
@ -6,6 +6,7 @@ import (
|
||||
"SciencesServer/app/basic/controller"
|
||||
model2 "SciencesServer/app/common/model"
|
||||
"SciencesServer/app/session"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
@ -32,11 +33,13 @@ func (c *Expert) research(page, pageSize int, count *int64, where ...*model2.Mod
|
||||
// 实验室下存在专家
|
||||
mUserResearch := model.NewUserResearch()
|
||||
|
||||
_, err := model2.FirstField(mUserResearch.UserResearch, []string{"id", "research_id"},
|
||||
isExist, err := model2.FirstField(mUserResearch.UserResearch, []string{"id", "research_id"},
|
||||
model2.NewWhere("uid", c.UID), model2.NewWhere("invalid_status", model2.InvalidStatusForNot))
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if !isExist {
|
||||
return nil, errors.New("操作错误,无权限查看")
|
||||
}
|
||||
// 查询科研机构下所有实验室
|
||||
mManageLaboratory := model.NewManageLaboratory()
|
||||
@ -107,6 +110,7 @@ func (c *Expert) Instance(name, mobile string, page, pageSize int) (*controller.
|
||||
out, err = c.research(page, pageSize, &count, where...)
|
||||
// 实验室
|
||||
} else if c.Identity == config.TenantUserIdentityForLaboratory {
|
||||
out, err = c.laboratory(page, pageSize, &count, where...)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user