Trova post "risolti" in un mese specifico

Gestisco Discourse in un ambiente aziendale come sistema per gli ordini e la documentazione. Uso i tag per indicare se un ordine (argomento) è in corso o completato. Tuttavia, avrei bisogno di un modo per identificare gli ordini completati, ad esempio, a marzo.

Non vorrei dover creare un tag per ogni mese, ad esempio tag: marzo19.

Ho un numero limitato di tag visibili nelle rispettive categorie per facilitare la creazione e la manutenzione degli ordini.

Ho pensato di usare gli hashtag: quando un ordine viene completato, la persona che lo ha consegnato potrebbe commentare con #marzo19 alla fine del thread, in modo da poter cercare per quel tag. Ma non mi sembra che gli hashtag funzionino come dovrebbero sul mio Discourse; forse la funzione è stata rimossa a favore del sistema di tag?

Esistono altri plugin o metodi per fare questo?
Ho bisogno di idee :slight_smile:

1 Mi Piace

If you have admin privileges you could use the data explorer plugin.

2 Mi Piace

Thanks, good suggestion but I am not so familiar with database inquiries so do not know if I even know where to start with it. Can anyone use / view the results of a request through data explorer in any way? Would be good if everyone could sort out examples delivered things in March easily and not just administrators.

Here is a starting point.

-- [params]
-- int :months_ago = 1

WITH query_period AS
(SELECT date_trunc('month', CURRENT_DATE) - INTERVAL ':months_ago months' AS period_start,
                                                    date_trunc('month', CURRENT_DATE) - INTERVAL ':months_ago months' + INTERVAL '1 month' - INTERVAL '1 second' AS period_end)
select posts.*
from posts
inner join ( 
	select topic_id, value::int accepted_answer_post_id 
	from topic_custom_fields 
	where name = 'accepted_answer_post_id'
	order by name 
) solved_by_post
on posts.id = solved_by_post.accepted_answer_post_id
inner join query_period
on posts.created_at >= query_period.period_start
AND posts.created_at <= query_period.period_end
order by posts.created_at desc 

solved-topics-in-month.dcquery (1).json (1.1 KB)

2 Mi Piace

You could run a cron job at the start of each month to get the results and then create a new topic … ‘Orders Completed in March 2019’ with links to each result in the topic.

1 Mi Piace