mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-08 02:55:58 +08:00
Merge remote-tracking branch 'origin/superGroup' into superGroup
This commit is contained in:
@@ -5,14 +5,14 @@ import (
|
||||
_ "github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
func GetRegister(account, areaCode string) (*db.Register, error) {
|
||||
func GetRegister(account, areaCode, userID string) (*db.Register, error) {
|
||||
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var r db.Register
|
||||
return &r, dbConn.Table("registers").Where("account = ? or account =? and area_code=?",
|
||||
account, account, areaCode).Take(&r).Error
|
||||
return &r, dbConn.Table("registers").Where("user_id = ? and user_id != ? or account = ? or account =? and area_code=?",
|
||||
userID, "", account, account, areaCode).Take(&r).Error
|
||||
}
|
||||
|
||||
func SetPassword(account, password, ex, userID, areaCode string) error {
|
||||
|
||||
@@ -302,6 +302,6 @@ func GetRandomDepartmentID() (string, error) {
|
||||
return "", err
|
||||
}
|
||||
department := &db.Department{}
|
||||
err = dbConn.Model(department).Order("RAND()").Where("related_group_id != ? AND department_id != ?", "", "0").First(department).Error
|
||||
err = dbConn.Model(department).Order("RAND()").Where("related_group_id != ? AND department_id != ? AND department_type = ?", "", "0", 1).First(department).Error
|
||||
return department.DepartmentID, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user