Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
194
Issues
194
List
Boards
Labels
Service Desk
Milestones
Merge Requests
27
Merge Requests
27
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Compare Revisions
d7f0d4434e21d29425c800a535c0e6d94b459b04...6a760f0373ec01fc08dfff63fb08882ad9caaffc
Source
6a760f0373ec01fc08dfff63fb08882ad9caaffc
Select Git revision
...
Target
d7f0d4434e21d29425c800a535c0e6d94b459b04
Select Git revision
Compare
Commits (3)
(fix) Notification view for user state should be plural rewards_* -
#589
· 167c20ef
Guy Thouret
authored
2 hours ago
167c20ef
(fix) Divide by zero error Contributions\DailyCollection -
#587
· d8348319
Guy Thouret
authored
2 hours ago
d8348319
(fix) Send a notification when a user is rewarded with tokens for contributions -
#636
· 6a760f03
Guy Thouret
authored
2 hours ago
6a760f03
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
Rewards.php
Controllers/Cli/Rewards.php
+8
-7
UpdateUserState.php
Core/Analytics/Delegates/UpdateUserState.php
+1
-1
DailyCollection.php
Core/Rewards/Contributions/DailyCollection.php
+1
-1
No files found.
Controllers/Cli/Rewards.php
View file @
6a760f03
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
Core/Analytics/Delegates/UpdateUserState.php
View file @
6a760f03
...
...
@@ -41,7 +41,7 @@ class UpdateUserState
{
if
(
$this
->
userState
->
getStateChange
()
!==
0
)
{
$notificationView
=
(
$this
->
userState
->
getStateChange
()
>
0
)
?
'reward
_state_increase'
:
'reward
_state_decrease'
;
'reward
s_state_increase'
:
'rewards
_state_decrease'
;
Dispatcher
::
trigger
(
'notification'
,
'reward'
,
[
'to'
=>
[
$this
->
userState
->
getUserGuid
()
...
...
This diff is collapsed.
Click to expand it.
Core/Rewards/Contributions/DailyCollection.php
View file @
6a760f03
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.