From 6ceaf9f6a5b611f82375b7a3c1dd5cf7b5db3ed5 Mon Sep 17 00:00:00 2001 From: CaIon <1808837298@qq.com> Date: Fri, 10 Nov 2023 01:59:01 +0800 Subject: [PATCH] fix log bug --- model/log.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/log.go b/model/log.go index 5ea9372..269230d 100644 --- a/model/log.go +++ b/model/log.go @@ -102,7 +102,7 @@ func GetAllLogs(logType int, startTimestamp int64, endTimestamp int64, modelName tx = tx.Where("created_at <= ?", endTimestamp) } if channel != 0 { - tx = tx.Where("channel = ?", channel) + tx = tx.Where("channel_id = ?", channel) } err = tx.Order("id desc").Limit(num).Offset(startIdx).Find(&logs).Error return logs, err @@ -165,7 +165,7 @@ func SumUsedQuota(logType int, startTimestamp int64, endTimestamp int64, modelNa tx = tx.Where("model_name = ?", modelName) } if channel != 0 { - tx = tx.Where("channel = ?", channel) + tx = tx.Where("channel_id = ?", channel) } tx.Where("type = ?", LogTypeConsume).Scan(&stat) return stat