diff --git a/web/yaamp/modules/site/SiteController.php b/web/yaamp/modules/site/SiteController.php index 5b153cc..41d16d6 100644 --- a/web/yaamp/modules/site/SiteController.php +++ b/web/yaamp/modules/site/SiteController.php @@ -657,6 +657,36 @@ class SiteController extends CommonController $this->goback(); } + public function actionCancelUsersPayment() + { + if(!$this->admin) return; + $coin = getdbo('db_coins', getiparam('id')); + if ($coin) { + $amount_failed = 0.0; $cnt = 0; + $time = time() - (48 * 3600); + $failed = getdbolist('db_payouts', "idcoin=:id AND IFNULL(tx,'') = '' AND time>$time", array(':id'=>$coin->id)); + if (!empty($failed)) { + foreach ($failed as $payout) { + $user = getdbo('db_accounts', $payout->account_id); + if ($user) { + $user->balance += floatval($payout->amount); + if ($user->save()) { + $amount_failed += floatval($payout->amount); + $cnt++; + } + } + $payout->delete(); + } + user()->setFlash('message', "Restored $cnt failed txs to user balances, $amount_failed {$coin->symbol}"); + } else { + user()->setFlash('message', 'No failed txs found'); + } + } else { + user()->setFlash('error', 'Invalid coin id!'); + } + $this->goback(); + } + ///////////////////////////////////////////////// public function actionUser() @@ -1070,6 +1100,9 @@ class SiteController extends CommonController public function actionGomining() { $algo = substr(getparam('algo'), 0, 32); + if ($algo == 'all') { + return; + } user()->setState('yaamp-algo', $algo); $this->redirect("/site/mining"); } diff --git a/web/yaamp/modules/site/payments_results.php b/web/yaamp/modules/site/payments_results.php index d764da1..e20a864 100644 --- a/web/yaamp/modules/site/payments_results.php +++ b/web/yaamp/modules/site/payments_results.php @@ -70,7 +70,7 @@ if (!empty($data)) foreach ($data as $row) { $failed[$uid] = $row['failed']; } -$list = getdbolist('db_accounts', "coinid!=6 $sqlFilter AND (". +$list = getdbolist('db_accounts', "is_locked != 1 $sqlFilter AND (". "balance > 0 OR last_earning > (UNIX_TIMESTAMP()-60*60) OR id IN (SELECT DISTINCT account_id FROM payouts WHERE tx IS NULL)". ") ORDER BY last_earning DESC $limit"); @@ -135,8 +135,10 @@ if ($coin_id) { echo '
Balances | '.bitcoinvaluetoa($total)." $symbol |
---|---|
Immature | '.bitcoinvaluetoa($totalimmat)." $symbol |
Failed | '.bitcoinvaluetoa($totalfailed)." $symbol |
'.'Reset all failed |