fix: cannot isolute mme radio info of multi-tenant

This commit is contained in:
2024-06-20 17:32:22 +08:00
parent 86d56a513f
commit 4f9ed3baaf

View File

@@ -752,7 +752,7 @@ func GetNBInfoFromNF(w http.ResponseWriter, r *http.Request) {
//var nbInfo *TenantNBInfo
_ = json.Unmarshal(resp.Body(), &response)
for i := 0; i < len(response.Data); i++ {
where = fmt.Sprintf("status='1' and tenancy_type='RADIO' and tenancy_key='%s'", response.Data[i].ID)
where = fmt.Sprintf("status='1' and tenancy_type='RADIO' and tenancy_key='%v'", response.Data[i].ID)
tenantID, _ = dborm.XormGetSingleColStringByWhere("sys_tenant", "parent_id", where)
where = fmt.Sprintf("status='1' and tenant_id='%s'", tenantID)
tenantName, _ = dborm.XormGetSingleColStringByWhere("sys_tenant", "tenant_name", where)
@@ -766,7 +766,7 @@ func GetNBInfoFromNF(w http.ResponseWriter, r *http.Request) {
var nbInfos NBInfoResponse
var nbIDs []string
// Get nodeB IDs by tenantID
where = fmt.Sprintf("status='1' and tenancy_type='RADIO' and parent_id='%s'", tenantID)
where = fmt.Sprintf("status='1' and tenancy_type='RADIO' and parent_id='%v'", tenantID)
dborm.XormFindColStringArrayByWhere("sys_tenant", "tenancy_key", where, &nbIDs)
_ = json.Unmarshal(resp.Body(), &nbInfos)
for _, n := range nbInfos.Data {