package service import ( "Xcx_New/models" "github.com/jinzhu/gorm" ) func GetXcxMobileInformation(mobile string) (*models.XcxAdminUserRole, error) { role := models.XcxAdminUserRole{} err := XTReadDB().Model(&role).Where("mobile = ? and status = 1", mobile).Find(&role).Error if err == gorm.ErrRecordNotFound { return nil, err } if err != nil { return nil, err } return &role, nil } func CreateXcxAdminUser(role models.XcxAdminUserRole) error { err := XTWriteDB().Create(&role).Error return err } func GetLoginInfor(mobile string) (models.XcxAdminUserRole, error) { role := models.XcxAdminUserRole{} err := XTReadDB().Model(&role).Where("mobile = ? and status = 1", mobile).Find(&role).Error return role, err }