Commit 51f731d7 authored by chenweijian's avatar chenweijian

群组指定分区

parent 74c1f6d3
...@@ -25,10 +25,11 @@ func (g *GroupTop) Delete(model *domain.Model) error { ...@@ -25,10 +25,11 @@ func (g *GroupTop) Delete(model *domain.Model) error {
func GroupTopGetAll(model *domain.Model, area int) ([]string, error) { func GroupTopGetAll(model *domain.Model, area int) ([]string, error) {
rows := make([]GroupTop, 0) rows := make([]GroupTop, 0)
err := model.DB().Table("group_top gt"). err := model.DB().Table("group_top").
Joins("left join group_info gi on gt.im_group_id = gi.im_group_id left join res_country rc on gi.country = rc.name"). Joins("left join group_info gi on group_top.im_group_id = gi.im_group_id "+
"left join res_country rc on gi.country = rc.name").
Where("rc.area = ?", area). Where("rc.area = ?", area).
Order("gt.id").Find(&rows).Error Order("group_top.id").Find(&rows).Error
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment