pull/455/head
wangchuxiao 2 years ago committed by Xinwei Xiong(cubxxw-openim)
parent 434f09c6d8
commit b3f924c081

@ -287,6 +287,6 @@ func GetRandomDepartmentID() (string, error) {
return "", err
}
department := &db.Department{}
err = dbConn.Model(department).Where("related_group_id != ? AND parent_id != ?", "", "").Take(department).Error
err = dbConn.Model(department).Order("RAND()").Where("related_group_id != ?", "").First(department).Error
return department.DepartmentID, err
}

Loading…
Cancel
Save