优化“知识库模块“--基本完善
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user