merge: main to multi-tenant
This commit is contained in:
@@ -250,10 +250,11 @@ func (r *UDMSubImpl) DeletePrefixByIMSI(neId, imsi string) int64 {
|
||||
func (r *UDMSubImpl) SetTenantID(subArr *[]model.UDMSub) {
|
||||
for s := 0; s < len(*subArr); s++ {
|
||||
var tenantID []string
|
||||
err := dborm.DefaultDB().Table("sys_tenant").
|
||||
Where("status='1' and tenancy_type='IMSI' and ? like tenancy_key", (*subArr)[s].Imsi).Cols("parent_id").Distinct().Find(&tenantID)
|
||||
err := datasource.DefaultDB().Table("sys_tenant").
|
||||
Where("status='1' and tenancy_type='IMSI' and ? like tenancy_key", (*subArr)[s].IMSI).
|
||||
Select("parent_id").Distinct().Find(&tenantID)
|
||||
if err != nil {
|
||||
log.Errorf("Find tenant_id err => %v", err)
|
||||
logger.Errorf("Find tenant_id err => %v", err)
|
||||
continue
|
||||
}
|
||||
if len(tenantID) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user