...
 
......@@ -92,13 +92,14 @@ class Rewards extends Cli\Controller implements Interfaces\CliControllerInterfac
$reward = $manager->sync();
$total = $total->add($reward->getAmount());
$leaderboard[$user->guid] = ($reward->getAmount() / (10**18));
/*Dispatcher::trigger('notification', 'contributions', [
'to' => [$user->guid],
'from' => 100000000000000519,
'notification_view' => 'contributions',
'params' => [ 'amount' => (string) BigNumber::_($reward->getAmount()) ],
'message' => ''
]);*/
if ($reward->getAmount() > 0) {
Dispatcher::trigger('notification', 'reward', [
'to' => [$user->guid],
'from' => Core\Notification\Notification::SYSTEM_ENTITY,
'notification_view' => 'rewards_summary',
'params' => ['amount' => (string)BigNumber::_($reward->getAmount())],
]);
}
$amnt = (int) $reward->getAmount();
echo "\n [$i][$guid]: synced past 48 hours. {$amnt}/$total";
} catch (\Exception $e) {
......
......@@ -41,7 +41,7 @@ class UpdateUserState
{
if ($this->userState->getStateChange() !== 0) {
$notificationView = ($this->userState->getStateChange() > 0) ?
'reward_state_increase' : 'reward_state_decrease';
'rewards_state_increase' : 'rewards_state_decrease';
Dispatcher::trigger('notification', 'reward', [
'to' => [
$this->userState->getUserGuid()
......
......@@ -65,7 +65,7 @@ class DailyCollection
error_log($e->getMessage());
}
$export[$timestamp]['share'] += ($contribution->getScore() / $totalScore) * 100;
$export[$timestamp]['share'] += ($totalScore == 0) ? 0 : ($contribution->getScore() / $totalScore) * 100;
}
return array_values($export);
......