This commit is contained in:
Sense T 2024-01-13 13:26:53 +08:00
parent fe13b65016
commit e02bca8ad2
2 changed files with 6 additions and 3 deletions

View File

@ -16,7 +16,7 @@ spec:
image: <Image>
resources:
limits:
memory: "128Mi"
memory: "64Mi"
cpu: "100m"
envFrom:
- secretRef:

View File

@ -83,9 +83,12 @@ impl Controller {
let query = match chat.is_group() || chat.is_supergroup() {
true => {
Stats::find()
Stats::find().select_only()
.column(StatsColumn::Name)
.column_as(StatsColumn::Counts.sum(), "counts")
.filter(StatsColumn::GroupId.eq(chat.id.0))
.order_by_desc(StatsColumn::Counts)
.group_by(StatsColumn::Name)
.order_by_desc(StatsColumn::Counts.sum())
.limit(LIMIT).into_model()
.all(&transcation)
.await