diff --git a/api/repositories/sqlalchemy_api_workflow_run_repository.py b/api/repositories/sqlalchemy_api_workflow_run_repository.py index be7a521881..eb2a32d764 100644 --- a/api/repositories/sqlalchemy_api_workflow_run_repository.py +++ b/api/repositories/sqlalchemy_api_workflow_run_repository.py @@ -749,13 +749,14 @@ WHERE """ Get average app interaction statistics using raw SQL for optimal performance. """ - sql_query = """SELECT + converted_created_at = convert_datetime_to_date("c.created_at") + sql_query = f"""SELECT AVG(sub.interactions) AS interactions, sub.date FROM ( SELECT - {convert_datetime_to_date("c.created_at")} AS date, + {converted_created_at} AS date, c.created_by, COUNT(c.id) AS interactions FROM @@ -764,8 +765,8 @@ FROM c.tenant_id = :tenant_id AND c.app_id = :app_id AND c.triggered_from = :triggered_from - {{start}} - {{end}} + {{{{start}}}} + {{{{end}}}} GROUP BY date, c.created_by ) sub diff --git a/web/app/components/billing/config.ts b/web/app/components/billing/config.ts index f343f4b487..5ab836ad18 100644 --- a/web/app/components/billing/config.ts +++ b/web/app/components/billing/config.ts @@ -3,7 +3,7 @@ import { Plan, type PlanInfo, Priority } from '@/app/components/billing/type' const supportModelProviders = 'OpenAI/Anthropic/Llama2/Azure OpenAI/Hugging Face/Replicate' -export const NUM_INFINITE = 99999999 +export const NUM_INFINITE = -1 export const contractSales = 'contractSales' export const unAvailable = 'unAvailable'