query.go 544 B

1234567891011121314151617
  1. package sys_role_admin
  2. import "hongze/hongze_yb/global"
  3. func GetVoiceAdmin(adminId int) (item *SysRoleAdmin, err error) {
  4. if global.CONFIG.Serve.RunMode == "release" {
  5. err = global.DEFAULT_MYSQL.Model(SysRoleAdmin{}).Where("role_id=32 AND admin_id=?",adminId).First(&item).Error
  6. }else {
  7. err = global.DEFAULT_MYSQL.Model(SysRoleAdmin{}).Where("role_id=33 AND admin_id=?",adminId).First(&item).Error
  8. }
  9. return
  10. }
  11. // TableName get sql table name.获取数据库表名
  12. func (m *SysRoleAdmin) TableName() string {
  13. return "sys_role_admin"
  14. }