优化“知识库模块“--基本完善

This commit is contained in:
Cheng Zhou
2025-12-26 14:07:28 +08:00
parent a1a4964cd2
commit 7c9befc3c9
23 changed files with 1345 additions and 110 deletions
@@ -0,0 +1,14 @@
ALTER TABLE public.faq_items
ADD COLUMN IF NOT EXISTS resolved_by_confirm boolean DEFAULT false NOT NULL;
UPDATE public.faq_items
SET status = CASE
WHEN best_reply_id IS NOT NULL THEN 'RESOLVED'
WHEN EXISTS (
SELECT 1 FROM public.faq_replies r
WHERE r.faq_id = faq_items.id AND r.is_deleted = false
) THEN 'PROCESSING'
ELSE 'PENDING'
END,
resolved_by_confirm = false
WHERE status = 'RESOLVED' AND best_reply_id IS NULL;