feat: add terminal-scoped transaction analytics
This commit is contained in:
@@ -22,7 +22,7 @@ func SeedDemo(ctx context.Context, pool *pgxpool.Pool, username, password string
|
||||
var merchantID int64
|
||||
err = pool.QueryRow(ctx, `SELECT m.id,m.source_key,m.display_name
|
||||
FROM merchants m JOIN payment_sessions ps ON ps.merchant_id=m.id
|
||||
GROUP BY m.id ORDER BY count(*) DESC,m.source_key LIMIT 1`).Scan(
|
||||
GROUP BY m.id ORDER BY (count(DISTINCT ps.terminal_id)>1) DESC,count(*) DESC,m.source_key LIMIT 1`).Scan(
|
||||
&merchantID, &result.MerchantSourceKey, &result.MerchantName,
|
||||
)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user