feat(channel): 支持安全删除渠道并保留历史数据
CI / Frontend (typecheck + lint + build) (push) Successful in 5m31s
CI / Backend (go vet + test) (push) Failing after 11m10s

This commit is contained in:
yml2213
2026-11-06 18:36:07 +08:00
parent 6297ea6634
commit de1ffbf4f6
10 changed files with 135 additions and 23 deletions
+2 -2
View File
@@ -145,7 +145,7 @@ func (h *SessionHandler) Export(c *gin.Context) {
channelMap := map[uint]model.Channel{}
if len(channelIDs) > 0 {
var channels []model.Channel
model.DB.Where("id IN ?", service.UniqueUint(channelIDs)).Find(&channels)
model.DB.Unscoped().Where("id IN ?", service.UniqueUint(channelIDs)).Find(&channels)
for _, ch := range channels {
channelMap[ch.ID] = ch
}
@@ -323,7 +323,7 @@ func (h *StatisticsHandler) Export(c *gin.Context) {
// 渠道
var channels []model.Channel
model.DB.Where("tenant_id = ?", tenantID).Find(&channels)
model.DB.Unscoped().Where("tenant_id = ?", tenantID).Find(&channels)
channelTypes := make(map[uint]string)
for _, channel := range channels {
channelTypes[channel.ID] = channel.Type