fix: merge issue
This commit is contained in:
@@ -79,6 +79,8 @@ func (r *UDMSubImpl) ClearAndInsert(neID string, u []model.UDMSub) int64 {
|
||||
if err != nil {
|
||||
logger.Errorf("TRUNCATE err => %v", err)
|
||||
}
|
||||
// multi-tenancy
|
||||
r.SetTenantID(&u)
|
||||
|
||||
return r.Inserts(u)
|
||||
}
|
||||
@@ -250,9 +252,9 @@ 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 := datasource.DefaultDB().Table("sys_tenant").
|
||||
err := dborm.DefaultDB().Table("sys_tenant").
|
||||
Where("status='1' and tenancy_type='IMSI' and ? like tenancy_key", (*subArr)[s].IMSI).
|
||||
Select("parent_id").Distinct().Find(&tenantID)
|
||||
Cols("parent_id").Distinct().Find(&tenantID)
|
||||
if err != nil {
|
||||
logger.Errorf("Find tenant_id err => %v", err)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user