mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: 修改统计字段
This commit is contained in:
parent
a6aa386523
commit
2cc7d8ccfb
|
|
@ -1,7 +1,7 @@
|
|||
SELECT SUM
|
||||
( CASE WHEN application_chat_record.vote_status = '0' THEN 1 ELSE 0 END ) AS "star_num",
|
||||
SUM ( CASE WHEN application_chat_record.vote_status = '1' THEN 1 ELSE 0 END ) AS "trample_num",
|
||||
SUM ( application_chat_record.message_tokens + application_chat_record.answer_tokens ) as "tokens_sum",
|
||||
SUM ( application_chat_record.message_tokens + application_chat_record.answer_tokens ) as "tokens_num",
|
||||
"count"(application_chat_record."id") as chat_record_count
|
||||
FROM
|
||||
application_chat_record application_chat_record
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
SELECT SUM
|
||||
( CASE WHEN application_chat_record.vote_status = '0' THEN 1 ELSE 0 END ) AS "star_num",
|
||||
SUM ( CASE WHEN application_chat_record.vote_status = '1' THEN 1 ELSE 0 END ) AS "trample_num",
|
||||
SUM ( application_chat_record.message_tokens + application_chat_record.answer_tokens ) as "tokens_sum",
|
||||
SUM ( application_chat_record.message_tokens + application_chat_record.answer_tokens ) as "tokens_num",
|
||||
"count"(application_chat_record."id") as chat_record_count,
|
||||
application_chat_record.create_time :: DATE as "day"
|
||||
FROM
|
||||
|
|
|
|||
|
|
@ -32,13 +32,13 @@ class ApplicationStatisticsApi(ApiMixin):
|
|||
def get_response_body_api():
|
||||
return openapi.Schema(
|
||||
type=openapi.TYPE_OBJECT,
|
||||
required=['star_num', 'trample_num', 'tokens_sum', 'chat_record_count'],
|
||||
required=['star_num', 'trample_num', 'tokens_num', 'chat_record_count'],
|
||||
properties={
|
||||
'star_num': openapi.Schema(type=openapi.TYPE_NUMBER, title="点赞数量",
|
||||
description="点赞数量"),
|
||||
|
||||
'trample_num': openapi.Schema(type=openapi.TYPE_NUMBER, title="点踩数量", description="点踩数量"),
|
||||
'tokens_sum': openapi.Schema(type=openapi.TYPE_NUMBER, title="token使用数量",
|
||||
'tokens_num': openapi.Schema(type=openapi.TYPE_NUMBER, title="token使用数量",
|
||||
description="token使用数量"),
|
||||
'chat_record_count': openapi.Schema(type=openapi.TYPE_NUMBER, title="对话次数",
|
||||
description="对话次数"),
|
||||
|
|
|
|||
Loading…
Reference in New Issue