29 lines
719 B
Go
29 lines
719 B
Go
package model
|
|
|
|
import (
|
|
"SciencesServer/app/common/model"
|
|
"SciencesServer/serve/orm"
|
|
)
|
|
|
|
type ManageExpert struct {
|
|
*model.ManageExpert
|
|
}
|
|
|
|
// Distribution 分布信息
|
|
func (m *ManageExpert) Distribution() ([]*DataAreaDistributionInfo, error) {
|
|
out := make([]*DataAreaDistributionInfo, 0)
|
|
|
|
err := orm.GetDB().Table(m.TableName()).
|
|
Select("province", "city", "GROUP_CONCAT(industry SEPARATOR '&') AS industry").
|
|
Group("province").Group("city").
|
|
Order("province "+model.OrderModeToAsc).Order("city "+model.OrderModeToAsc).
|
|
Where("examine_status = ?", model.ExamineStatusForAgree).
|
|
Scan(&out).Error
|
|
|
|
return out, err
|
|
}
|
|
|
|
func NewManageExpert() *ManageExpert {
|
|
return &ManageExpert{model.NewManageExpert()}
|
|
}
|