I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).

If you are new here, please see some information on how to ask for support. Thank you!

Reply To: Important Issue!

#4412
alexg
Keymaster

Assuming the table prefix is wp_, and if the installation is not multisite, then the following query would show you the user ids, coins and balances that are negative:

SELECT
	account,
	symbol,
	SUM( IF( amount > 0, amount - fee, amount ) ) AS balance
FROM
	wp_wallets_txs
WHERE
	status = 'done'
GROUP BY
	account,
	symbol
HAVING
	balance < 0;

If you are on a multisite installation with multiple blogs, you should also group by blog_id:

SELECT
	blog_id,
	account,
	symbol,
	SUM( IF( amount > 0, amount - fee, amount ) ) AS balance
FROM
	wp_wallets_txs
WHERE
	status = 'done'
GROUP BY
	blog_id,
	account,
	symbol
HAVING
	balance < 0;