fix: multi-tenant phase 2
This commit is contained in:
@@ -236,6 +236,7 @@ func (r *SysTenantImpl) IsUniqueTenancy(sysTenant model.SysTenant) bool {
|
||||
// 查询条件拼接
|
||||
var conditions []string
|
||||
var params []any
|
||||
|
||||
if sysTenant.TenantID != "" {
|
||||
conditions = append(conditions, "tenant_id != ?")
|
||||
params = append(params, sysTenant.TenantID)
|
||||
@@ -245,8 +246,9 @@ func (r *SysTenantImpl) IsUniqueTenancy(sysTenant model.SysTenant) bool {
|
||||
params = append(params, sysTenant.TenancyType)
|
||||
}
|
||||
if sysTenant.TenancyKey != "" {
|
||||
conditions = append(conditions, "? like tenancy_key")
|
||||
params = append(params, sysTenant.TenancyKey)
|
||||
conditions = append(conditions, "(? like tenancy_key or tenancy_key like ?)")
|
||||
//conditions = append(conditions, "(LOCATE(?, tenancy_key)>0 or LOCATE(tenancy_key, ?)>0)")
|
||||
params = append(params, sysTenant.TenancyKey, sysTenant.TenancyKey)
|
||||
}
|
||||
|
||||
// 构建查询条件语句
|
||||
|
||||
Reference in New Issue
Block a user