feat:完善信息,增加需求指派功能

This commit is contained in:
henry
2022-01-24 15:35:43 +08:00
parent 295ca23dcc
commit 1c0d9dfb6b
12 changed files with 184 additions and 68 deletions

View File

@ -16,6 +16,27 @@ type ManageAgentInfo struct {
model.Area
}
func (m *ManageAgent) Agent(where ...*model.ModelWhere) ([]*model.ManageAgent, error) {
db := orm.GetDB().Table(m.TableName()).
Select("id", "name", "mobile")
if len(where) > 0 {
for _, v := range where {
if v.Condition == "" {
db.Where(v.Value)
continue
}
db = db.Where(v.Condition, v.Value)
}
}
out := make([]*model.ManageAgent, 0)
if err := db.Scan(&out).Error; err != nil {
return nil, err
}
return out, nil
}
// Agents 经纪人信息
func (m *ManageAgent) Agents(page, pageSize int, count *int64, where ...*model.ModelWhere) ([]*ManageAgentInfo, error) {
db := orm.GetDB().Table(m.TableName()+" AS a").

View File

@ -0,0 +1,11 @@
package model
import "SciencesServer/app/common/model"
type TechnologyDemandService struct {
*model.TechnologyDemandService
}
func NewTechnologyDemandService() *TechnologyDemandService {
return &TechnologyDemandService{model.NewTechnologyDemandService()}
}