Skip to content

Business queries ​

Read-only aggregate queries for the monthly metrics refresh. Run on the 1st of each month; results go into the monthly table in ../kpis.md.

Run each file through tinker in the production web container (counts only, never personal data):

sh
C=$(ssh nit-server "docker ps --format '{{.Names}}' | grep ^nit-web- | grep -v staging | head -1")
ssh nit-server "docker exec -i $C php artisan tinker" < q2.php
  • q1: table columns, row counts and date ranges
  • q2: shops, products, orders by month; repeat buyers; orders by category
  • q3: visits and active products by category
  • q4–q6: interactions, share links and contact click-outs by month

Until the host move the nit DB is a production copy to about 19–21 Sep 2026; exclude rows from 22 Sep on.