diff --git a/api/app/core/memory/storage_services/forgetting_engine/forgetting_scheduler.py b/api/app/core/memory/storage_services/forgetting_engine/forgetting_scheduler.py index acd436c7..8432c4dd 100644 --- a/api/app/core/memory/storage_services/forgetting_engine/forgetting_scheduler.py +++ b/api/app/core/memory/storage_services/forgetting_engine/forgetting_scheduler.py @@ -353,7 +353,7 @@ class ForgettingScheduler: return results[0]['total'] return 0 - async def _sync_memory_count_to_mysql( + async def _sync_memory_count_to_db( self, end_user_id: Optional[str] = None, ) -> None: diff --git a/api/app/services/memory_dashboard_service.py b/api/app/services/memory_dashboard_service.py index 6ce793a1..64874caf 100644 --- a/api/app/services/memory_dashboard_service.py +++ b/api/app/services/memory_dashboard_service.py @@ -130,20 +130,13 @@ def get_workspace_end_users_paginated( if keyword: keyword_pattern = f"%{keyword}%" - # other_name 匹配始终生效;id 匹配仅对 other_name 为空的记录生效 base_query = base_query.filter( or_( EndUserModel.other_name.ilike(keyword_pattern), - and_( - or_( - EndUserModel.other_name.is_(None), - EndUserModel.other_name == "", - ), - cast(EndUserModel.id, String).ilike(keyword_pattern), - ), + cast(EndUserModel.id, String).ilike(keyword_pattern), ) ) - business_logger.info(f"应用模糊搜索: keyword={keyword}(匹配 other_name;other_name 为空时匹配 id)") + business_logger.info(f"应用模糊搜索: keyword={keyword}(匹配 other_name 或 id)") # 获取总记录数 total = base_query.count() @@ -232,13 +225,7 @@ def get_workspace_end_users_paginated_rag( base_query = base_query.filter( or_( EndUserModel.other_name.ilike(keyword_pattern), - and_( - or_( - EndUserModel.other_name.is_(None), - EndUserModel.other_name == "", - ), - cast(EndUserModel.id, String).ilike(keyword_pattern), - ), + cast(EndUserModel.id, String).ilike(keyword_pattern), ) )