feat:优化项目信息

This commit is contained in:
henry
2022-02-09 17:35:31 +08:00
parent 2d8be509b7
commit 56e8243724
15 changed files with 357 additions and 54 deletions

View File

@ -33,7 +33,7 @@ type (
// PatentInfo 专利信息
PatentInfo struct {
ID string `json:"id"`
*model.TechnologyPatentBasicInfo
*model.UserPatentInfo
}
// PaperInfo 论文信息
PaperInfo struct {
@ -122,25 +122,20 @@ func project(uids []uint64, page, pageSize int) (*controller.ReturnPages, error)
// patent 专利信息
func patent(uids []uint64, page, pageSize int) (*controller.ReturnPages, error) {
mTechnologyPatent := model.NewTechnologyPatent()
var count int64
out := make([]*model.TechnologyPatentBasicInfo, 0)
mUserPatent := model.NewUserPatent()
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 {
var count int64
out, err := mUserPatent.Patents(uids, page, pageSize, &count)
if err != nil {
return nil, err
}
list := make([]*PatentInfo, 0)
for _, v := range out {
list = append(list, &PatentInfo{
ID: v.GetEncodeID(), TechnologyPatentBasicInfo: v,
ID: v.GetEncodeID(), UserPatentInfo: v,
})
}
return &controller.ReturnPages{Data: list, Count: count}, nil