feat: 调整cdr数据查询
This commit is contained in:
@@ -57,8 +57,8 @@ func (s *SMFController) CDRList(c *gin.Context) {
|
||||
querys.RmUID = neInfo.RmUID
|
||||
|
||||
// 查询数据
|
||||
data := s.cdrEventService.SelectPage(querys)
|
||||
c.JSON(200, result.Ok(data))
|
||||
rows, total := s.cdrEventService.SelectPage(querys)
|
||||
c.JSON(200, result.Ok(map[string]any{"rows": rows, "total": total}))
|
||||
}
|
||||
|
||||
// CDR会话删除
|
||||
@@ -109,13 +109,12 @@ func (s *SMFController) CDRExport(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
querys.RmUID = neInfo.RmUID
|
||||
data := s.cdrEventService.SelectPage(querys)
|
||||
if parse.Number(data["total"]) == 0 {
|
||||
rows, total := s.cdrEventService.SelectPage(querys)
|
||||
if total == 0 {
|
||||
// 导出数据记录为空
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
|
||||
return
|
||||
}
|
||||
rows := data["rows"].([]model.CDREventSMF)
|
||||
|
||||
// 导出文件名称
|
||||
fileName := fmt.Sprintf("smf_cdr_event_export_%d_%d.xlsx", len(rows), time.Now().UnixMilli())
|
||||
|
||||
Reference in New Issue
Block a user