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
192
Issues
192
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
3b80c207b9f96e24b20beaa9cde0907a5ff8a904...d7f0d4434e21d29425c800a535c0e6d94b459b04
Source
d7f0d4434e21d29425c800a535c0e6d94b459b04
Select Git revision
...
Target
3b80c207b9f96e24b20beaa9cde0907a5ff8a904
Select Git revision
Compare
Commits (2)
(fix) Record null value for old contributions score by omitting from INSERT query -
#587
· c11424f2
Guy Thouret
authored
20 hours ago
c11424f2
(feat) Add current reward factor to contributions api -
#661
· d7f0d443
Guy Thouret
authored
15 minutes ago
d7f0d443
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
overview.php
Controllers/api/v2/blockchain/contributions/overview.php
+1
-0
Overview.php
Core/Rewards/Contributions/Overview.php
+12
-0
Repository.php
Core/Rewards/Contributions/Repository.php
+0
-2
No files found.
Controllers/api/v2/blockchain/contributions/overview.php
View file @
d7f0d443
...
...
@@ -33,6 +33,7 @@ class overview implements Interfaces\Api
'yourContribution'
=>
$overview
->
getYourContribution
(),
'totalNetworkContribution'
=>
$overview
->
getTotalNetworkContribution
(),
'yourShare'
=>
$overview
->
getYourShare
(),
'yourRewardFactor'
=>
$overview
->
getYourRewardFactor
()
];
return
Factory
::
response
(
$response
);
}
...
...
This diff is collapsed.
Click to expand it.
Core/Rewards/Contributions/Overview.php
View file @
d7f0d443
...
...
@@ -8,6 +8,7 @@
namespace
Minds\Core\Rewards\Contributions
;
use
Minds\Core\Analytics\UserStates\RewardFactor
;
use
Minds\Core\Data\cache\abstractCacher
;
use
Minds\Core\Di\Di
;
use
Minds\Core\Util\BigNumber
;
...
...
@@ -41,6 +42,8 @@ class Overview
/** @var float */
protected
$yourShare
=
0
;
/** @var float */
protected
$yourRewardFactor
=
1
;
public
function
__construct
(
$sums
=
null
,
$repository
=
null
,
$manager
=
null
,
$cache
=
null
)
{
...
...
@@ -62,6 +65,7 @@ class Overview
$this
->
yourContribution
=
0
;
$this
->
totalNetworkContribution
=
0
;
$this
->
yourShare
=
0
;
$this
->
yourRewardFactor
=
RewardFactor
::
getForUserState
(
$this
->
user
->
getUserState
());
return
$this
;
}
...
...
@@ -161,6 +165,14 @@ class Overview
return
$this
->
yourShare
;
}
/**
* @return float
*/
public
function
getYourRewardFactor
()
{
return
$this
->
yourRewardFactor
;
}
/**
* Returns the last timestamp stored for a user's contribution
* @return bool|float
...
...
This diff is collapsed.
Click to expand it.
Core/Rewards/Contributions/Repository.php
View file @
d7f0d443
...
...
@@ -32,7 +32,6 @@ class Repository
user_guid,
metric,
amount,
score,
score_decimal
)
VALUES (?,?,?,?,?)"
;
...
...
@@ -44,7 +43,6 @@ class Repository
new
Varint
(
$contribution
->
getUser
()
->
guid
),
$contribution
->
getMetric
(),
new
Varint
(
$contribution
->
getAmount
()),
null
,
new
Decimal
(
$contribution
->
getScore
())
]
];
...
...
This diff is collapsed.
Click to expand it.