fix(admin): qualify ambiguous column name in marketplace_activity query

`credit_ledger cl` joined with `suppliers s` — both have `id`, so
SQLite raised OperationalError. Qualify as `cl.id` and `cl.supplier_id`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Deeman
2026-02-27 13:59:30 +01:00
parent f048e8276f
commit 49820391ab

View File

@@ -881,7 +881,7 @@ async def marketplace_activity():
FROM lead_forwards lf FROM lead_forwards lf
JOIN suppliers s ON s.id = lf.supplier_id JOIN suppliers s ON s.id = lf.supplier_id
UNION ALL UNION ALL
SELECT 'credit' as event_type, id as ref_id, supplier_id as ref2_id, SELECT 'credit' as event_type, cl.id as ref_id, cl.supplier_id as ref2_id,
s.name as actor, cl.event_type as detail, s.name as actor, cl.event_type as detail,
CAST(cl.delta AS TEXT) as extra, cl.created_at CAST(cl.delta AS TEXT) as extra, cl.created_at
FROM credit_ledger cl FROM credit_ledger cl