Skip to content

Instantly share code, notes, and snippets.

@calvez
Created February 8, 2018 13:41
Show Gist options
  • Save calvez/9535d3d0cc43b8d9afb061f957309f88 to your computer and use it in GitHub Desktop.
Save calvez/9535d3d0cc43b8d9afb061f957309f88 to your computer and use it in GitHub Desktop.
if (!empty($badusers)) {
foreach ($badusers as $bu) {
$output .= "PROBLEM with uid [<b>".$bu['userid']."</b>]: freemoney [<b>".n($bu['freemoney'])."</b>] should be [<b>".n($bu['calculated'])."</b>], diff is [<b>".n(abs($bu['freemoney']-$bu['calculated']))."</b>]<br/>\n";
if ($bu['calculated'] >= 0) {
if (!$sim) {
$conn->execute('update betusers set freemoney = '.$bu['calculated'].' where userid = '.$bu['userid']);
}
$output .= "Fixed with sql update.<br />\n";
} else {
$output .= "Negative value, not fixed, check manually!<br />\n";
}
}
$mail = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment