feat:完善项目信息

This commit is contained in:
henry
2022-01-20 11:51:02 +08:00
parent 9348c8970c
commit b87cd837be
23 changed files with 86 additions and 83 deletions

View File

@ -2,6 +2,7 @@ package search
import (
"SciencesServer/app/api/website/model"
"SciencesServer/app/basic/controller"
model2 "SciencesServer/app/common/model"
"fmt"
"time"
@ -22,7 +23,7 @@ type (
)
// searchDemand 需求搜索
func searchDemand(page, pageSize int, keyword, industry string, params map[string]interface{}) (interface{}, error) {
func searchDemand(page, pageSize int, keyword, industry string, params map[string]interface{}) (*controller.ReturnPages, error) {
mTechnologyDemand := model.NewTechnologyDemand()
where := make([]*model2.ModelWhere, 0)
@ -39,7 +40,9 @@ func searchDemand(page, pageSize int, keyword, industry string, params map[strin
where = append(where, model2.NewWhere(k, v))
}
}
out, err := mTechnologyDemand.Demand(where...)
var count int64
out, err := mTechnologyDemand.Demand(page, pageSize, &count, where...)
if err != nil {
return nil, err
@ -57,5 +60,5 @@ func searchDemand(page, pageSize int, keyword, industry string, params map[strin
CompanyKind: v.CompanyKind,
})
}
return list, nil
return &controller.ReturnPages{Data: list, Count: count}, nil
}