feat:完善信息,增加需求指派功能
This commit is contained in:
@ -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").
|
||||
|
Reference in New Issue
Block a user