feat:优化项目信息,待测试修改
This commit is contained in:
@ -33,7 +33,7 @@ type (
|
||||
// PatentInfo 专利信息
|
||||
PatentInfo struct {
|
||||
ID string `json:"id"`
|
||||
*model.PatentInfo
|
||||
*model.TechnologyPatentBasicInfo
|
||||
}
|
||||
// PaperInfo 论文信息
|
||||
PaperInfo struct {
|
||||
@ -122,20 +122,25 @@ func project(uids []uint64, page, pageSize int) (*controller.ReturnPages, error)
|
||||
|
||||
// patent 专利信息
|
||||
func patent(uids []uint64, page, pageSize int) (*controller.ReturnPages, error) {
|
||||
mUserPatent := model.NewUserPatent()
|
||||
mTechnologyPatent := model.NewTechnologyPatent()
|
||||
var count int64
|
||||
out := make([]*model.TechnologyPatentBasicInfo, 0)
|
||||
|
||||
out, err := mUserPatent.Patent(page, pageSize, &count, model2.NewWhereIn("u_p.uid", uids))
|
||||
|
||||
if err != nil {
|
||||
if err := model2.PagesFields(mTechnologyPatent.TechnologyPatent, &out, []string{
|
||||
"id", "title", "apply_at", "description",
|
||||
}, page, pageSize, &count, &model2.ModelWhereOrder{
|
||||
Where: model2.NewWhere("uid", uids),
|
||||
Order: model2.NewOrder("id", model2.OrderModeToDesc),
|
||||
}, &model2.ModelWhereOrder{
|
||||
Where: model2.NewWhere("shelf_status", model2.ShelfStatusForUp),
|
||||
}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
list := make([]*PatentInfo, 0)
|
||||
|
||||
for _, v := range out {
|
||||
list = append(list, &PatentInfo{
|
||||
ID: v.GetEncodeID(),
|
||||
PatentInfo: v,
|
||||
ID: v.GetEncodeID(), TechnologyPatentBasicInfo: v,
|
||||
})
|
||||
}
|
||||
return &controller.ReturnPages{Data: list, Count: count}, nil
|
||||
@ -216,17 +221,17 @@ func cooperateDetail(id uint64) (*CooperateDetailInfo, error) {
|
||||
Paper: make([]*technology.PaperInfo, 0),
|
||||
}
|
||||
// 专利信息
|
||||
mSysPatent := model.NewSysPatent()
|
||||
mTechnologyPatent := model.NewTechnologyPatent()
|
||||
|
||||
patents := make([]*model.SysPatentInfo, 0)
|
||||
patents := make([]*model.TechnologyPatentInfo, 0)
|
||||
|
||||
if patents, err = mSysPatent.Instance(model2.NewWhereIn("p.id", strings.Split(mManageCooperateEnterprise.Patent, ","))); err != nil {
|
||||
if patents, err = mTechnologyPatent.Instance(model2.NewWhereIn("p.id", strings.Split(mManageCooperateEnterprise.Patent, ","))); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, v := range patents {
|
||||
out.Patent = append(out.Patent, &technology.PatentInfo{
|
||||
ID: v.GetEncodeID(),
|
||||
SysPatentInfo: v,
|
||||
ID: v.GetEncodeID(),
|
||||
TechnologyPatentInfo: v,
|
||||
})
|
||||
}
|
||||
// 论文信息
|
||||
|
@ -58,15 +58,15 @@ func (c *Expert) Instance(id uint64) (*ExpertInstanceInfo, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
mSysPatent := model.NewSysPatent()
|
||||
mTechnologyPatent := model.NewTechnologyPatent()
|
||||
|
||||
patentTitles := make([]string, 0)
|
||||
|
||||
if out.PatentTitle != "" {
|
||||
for _, val := range strings.Split(out.PatentTitle, "&&") {
|
||||
objs := strings.Split(val, "$$")
|
||||
mSysPatent.Kind = model2.SysParentKind(utils.StringToInt(objs[0]))
|
||||
patentTitles = append(patentTitles, fmt.Sprintf("【%s】%s", mSysPatent.KindTitle(), objs[1]))
|
||||
mTechnologyPatent.Kind = model2.SysParentKind(utils.StringToInt(objs[0]))
|
||||
patentTitles = append(patentTitles, fmt.Sprintf("【%s】%s", mTechnologyPatent.KindTitle(), objs[1]))
|
||||
}
|
||||
}
|
||||
_industrys := make([]string, 0)
|
||||
|
Reference in New Issue
Block a user