package models import ( "eta/eta_task/global" "eta/eta_task/utils" ) type Admin struct { AdminId int `gorm:"column:admin_id;primaryKey;autoIncrement"` AdminName string `description:"系统用户名称"` RealName string `description:"系统用户姓名"` Password string `description:"密码"` Mobile string `description:"手机号"` RoleId int `description:"角色id"` RoleName string `description:"角色名称"` RoleTypeCode string `description:"角色编码"` DepartmentId int `description:"部门id"` GroupId int `description:"分组id"` Authority int `description:"管理权限,0:无,1:部门负责人,2:小组负责人"` Position string `description:"职位"` OpenId string `description:"弘则部门公众号的openid"` } func GetAdminByAdminId(adminId int) (item *Admin, err error) { sql := `SELECT * FROM admin WHERE admin_id=? ` sql = utils.ReplaceDriverKeywords("", sql) err = global.DbMap[utils.DbNameWeekly].Raw(sql, adminId).First(&item).Error return }