fix: ims CDR issue with recordType
This commit is contained in:
@@ -93,11 +93,14 @@ func (r *CDREventIMSImpl) SelectPage(querys model.CDREventIMSQuery) map[string]a
|
|||||||
}
|
}
|
||||||
if querys.RecordType != "" {
|
if querys.RecordType != "" {
|
||||||
recordTypes := strings.Split(querys.RecordType, ",")
|
recordTypes := strings.Split(querys.RecordType, ",")
|
||||||
placeholder := repo.KeyPlaceholderByQuery(len(recordTypes))
|
// placeholder := repo.KeyPlaceholderByQuery(len(recordTypes))
|
||||||
conditions = append(conditions, fmt.Sprintf("JSON_EXTRACT(cdr_json, '$.recordType') in (%s)", placeholder))
|
// conditions = append(conditions, fmt.Sprintf("JSON_EXTRACT(cdr_json, '$.recordType') in (%s)", placeholder))
|
||||||
|
var querys []string
|
||||||
for _, recordType := range recordTypes {
|
for _, recordType := range recordTypes {
|
||||||
params = append(params, recordType)
|
querys = append(querys, fmt.Sprintf("JSON_EXTRACT(cdr_json, '$.recordType') = '%s'", recordType))
|
||||||
|
//params = append(params, recordType)
|
||||||
}
|
}
|
||||||
|
conditions = append(conditions, "("+strings.Join(querys, " OR ")+")")
|
||||||
}
|
}
|
||||||
|
|
||||||
// for multi-tenancy solution
|
// for multi-tenancy solution
|
||||||
|
|||||||
Reference in New Issue
Block a user