feat:优化项目信息,待测试修改

This commit is contained in:
henry
2022-02-06 18:01:32 +08:00
parent c8578940bf
commit a25464289f
25 changed files with 404 additions and 483 deletions

View File

@ -23,12 +23,12 @@ type (
// PatentInfo 专利信息
PatentInfo struct {
ID string `json:"id"`
*model.PatentInstance
*model.TechnologyPatentBasicInfo
}
// PatentInstance 专利信息
PatentInstance struct {
ID string `json:"id"`
*model.SysPatentInfo
*model.TechnologyPatentInfo
}
// PaperInstance 论文信息
PaperInstance struct {
@ -113,23 +113,30 @@ 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.Instance(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(), PatentInstance: v,
ID: v.GetEncodeID(), TechnologyPatentBasicInfo: v,
})
}
return &controller.ReturnPages{Data: list, Count: count}, nil
}
func paper(uids []uint64, page, pageSize int) (*controller.ReturnPages, error) {
mTechnologyPaper := model.NewTechnologyPaper()
@ -204,17 +211,17 @@ func cooperateDetail(id uint64) (*CooperateDetailInfo, error) {
Paper: make([]*PaperInstance, 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", mManageCooperateEnterprise.GetPatentAttribute())); err != nil {
if patents, err = mTechnologyPatent.Instance(model2.NewWhereIn("p.id", mManageCooperateEnterprise.GetPatentAttribute())); err != nil {
return nil, err
}
for _, v := range patents {
out.Patent = append(out.Patent, &PatentInstance{
ID: v.GetEncodeID(),
SysPatentInfo: v,
ID: v.GetEncodeID(),
TechnologyPatentInfo: v,
})
}
// 论文信息