feat: SMF-CDR添加DNN搜索条件

This commit is contained in:
TsMask
2025-01-17 15:25:20 +08:00
parent 2fa5920100
commit 1cc53a734f
2 changed files with 4 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ type CDREventSMFQuery struct {
RmUID string `json:"rmUID" form:"rmUID"` RmUID string `json:"rmUID" form:"rmUID"`
RecordType string `json:"recordType" form:"recordType"` // 暂时没用到 RecordType string `json:"recordType" form:"recordType"` // 暂时没用到
SubscriberID string `json:"subscriberID" form:"subscriberID"` SubscriberID string `json:"subscriberID" form:"subscriberID"`
DNN string `json:"dnn" form:"dnn"`
StartTime string `json:"startTime" form:"startTime"` StartTime string `json:"startTime" form:"startTime"`
EndTime string `json:"endTime" form:"endTime"` EndTime string `json:"endTime" form:"endTime"`
SortField string `json:"sortField" form:"sortField" binding:"omitempty,oneof=timestamp"` // 排序字段,填写结果字段 SortField string `json:"sortField" form:"sortField" binding:"omitempty,oneof=timestamp"` // 排序字段,填写结果字段

View File

@@ -42,6 +42,9 @@ func (r CDREventSMF) SelectByPage(querys model.CDREventSMFQuery) ([]model.CDREve
if querys.SubscriberID != "" { if querys.SubscriberID != "" {
tx = tx.Where("JSON_EXTRACT(cdr_json, '$.subscriberIdentifier.subscriptionIDData') = ?", querys.SubscriberID) tx = tx.Where("JSON_EXTRACT(cdr_json, '$.subscriberIdentifier.subscriptionIDData') = ?", querys.SubscriberID)
} }
if querys.DNN != "" {
tx = tx.Where("JSON_EXTRACT(cdr_json, '$.pDUSessionChargingInformation.dNNID') = ?", querys.DNN)
}
// 查询结果 // 查询结果
var total int64 = 0 var total int64 = 0