package models import "time" // 企业申请类型 / 状态 const ( TenantApplyTypeJoin = 1 // 加入企业(绑定企业,企业管理员审批) TenantApplyTypeCreate = 2 // 创建企业(平台审批) TenantApplyStatusPending = 0 // 待审核 TenantApplyStatusPassed = 1 // 已通过 TenantApplyStatusReject = 2 // 已驳回 ) // AuthTenantApply 注册企业绑定/创建申请:yz_auth_tenant_apply // // 统一认证注册第二步产生: // - type=join:绑定企业申请,由目标企业的管理员在 backend「加入申请」页审批, // 通过后建立身份-企业绑定(默认「租户用户」角色); // - type=create:创建企业申请(含营业执照),由平台在 platform「企业创建审核」页审批, // 通过后自动创建租户并把申请人绑定为租户管理员。 type AuthTenantApply struct { ID uint64 `orm:"column(id);pk;auto" json:"id"` IdentityID uint64 `orm:"column(identity_id)" json:"identity_id"` // 小程序「挂靠企业」填写的资料:姓名 / 部门 / 职位 / 微信手机号(只读,后端取身份手机号) ApplicantName string `orm:"column(applicant_name);size(64);default('')" json:"applicant_name"` DepartmentID uint64 `orm:"column(department_id);default(0)" json:"department_id"` DepartmentName string `orm:"column(department_name);size(128);default('')" json:"department_name"` PositionID uint64 `orm:"column(position_id);default(0)" json:"position_id"` PositionName string `orm:"column(position_name);size(128);default('')" json:"position_name"` WechatMobile string `orm:"column(wechat_mobile);size(20);default('')" json:"wechat_mobile"` Type int8 `orm:"column(type);default(1)" json:"type"` Tid uint64 `orm:"column(tid);default(0)" json:"tid"` TenantName string `orm:"column(tenant_name);size(128);default('')" json:"tenant_name"` CreditCode string `orm:"column(credit_code);size(64);default('')" json:"credit_code"` LegalPerson string `orm:"column(legal_person);size(64);default('')" json:"legal_person"` LicenseFile string `orm:"column(license_file);size(500);default('')" json:"license_file"` ContactPerson string `orm:"column(contact_person);size(64);default('')" json:"contact_person"` ContactPhone string `orm:"column(contact_phone);size(20);default('')" json:"contact_phone"` ContactEmail string `orm:"column(contact_email);size(128);default('')" json:"contact_email"` Address string `orm:"column(address);size(255);default('')" json:"address"` Status int8 `orm:"column(status);default(0)" json:"status"` RejectReason string `orm:"column(reject_reason);size(255);default('')" json:"reject_reason"` ReviewerID uint64 `orm:"column(reviewer_id);default(0)" json:"reviewer_id"` ReviewerName string `orm:"column(reviewer_name);size(64);default('')" json:"reviewer_name"` ReviewTime *time.Time `orm:"column(review_time);type(datetime);null" json:"review_time"` CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"` UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"` DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"` } func (m *AuthTenantApply) TableName() string { return "yz_auth_tenant_apply" }