WiP to disable fees for specific accounts
* added new account table column: `no_fee` * honor `no_fee` flag during payout process * added upgrade SQL file for this feature Address #260
This commit is contained in:
parent
44c31fe630
commit
3cfef93580
@ -130,7 +130,7 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
|
||||
$aData['fee' ] = 0;
|
||||
$aData['donation'] = 0;
|
||||
|
||||
if ($config['fees'] > 0)
|
||||
if ($config['fees'] > 0 && $aData['no_fees'] == 0)
|
||||
$aData['fee'] = number_format(round($config['fees'] / 100 * $aData['payout'], 8), 8);
|
||||
// Calculate donation amount, fees not included
|
||||
$aData['donation'] = number_format(round($user->getDonatePercent($user->getUserId($aData['username'])) / 100 * ( $aData['payout'] - $aData['fee']), 8), 8);
|
||||
|
||||
@ -72,7 +72,7 @@ foreach ($aAccountShares as $aData) {
|
||||
$aData['donation'] = 0;
|
||||
|
||||
// Calculate block fees
|
||||
if ($config['fees'] > 0)
|
||||
if ($config['fees'] > 0 && $aData['no_fees'] == 0)
|
||||
$aData['fee'] = number_format(round($config['fees'] / 100 * $aData['payout'], 8), 8);
|
||||
// Calculate donation amount
|
||||
$aData['donation'] = number_format(round($user->getDonatePercent($user->getUserId($aData['username'])) / 100 * ( $aData['payout'] - $aData['fee']), 8), 8);
|
||||
|
||||
@ -66,7 +66,7 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
|
||||
$aData['fee' ] = 0;
|
||||
$aData['donation'] = 0;
|
||||
|
||||
if ($config['fees'] > 0)
|
||||
if ($config['fees'] > 0 && $aData['no_fees'] == 0)
|
||||
$aData['fee'] = number_format(round($config['fees'] / 100 * $aData['payout'], 8), 8);
|
||||
// Calculate donation amount, fees not included
|
||||
$aData['donation'] = number_format(round($user->getDonatePercent($user->getUserId($aData['username'])) / 100 * ( $aData['payout'] - $aData['fee']), 8), 8);
|
||||
|
||||
@ -97,6 +97,7 @@ class Share {
|
||||
SELECT
|
||||
a.id,
|
||||
SUBSTRING_INDEX( s.username , '.', 1 ) as username,
|
||||
a.no_fees AS no_fees,
|
||||
IFNULL(SUM(IF(our_result='Y', 1, 0)), 0) AS valid,
|
||||
IFNULL(SUM(IF(our_result='N', 1, 0)), 0) AS invalid
|
||||
FROM $this->table AS s
|
||||
@ -135,6 +136,7 @@ class Share {
|
||||
SELECT
|
||||
a.id,
|
||||
SUBSTRING_INDEX( s.username , '.', 1 ) as account,
|
||||
a.no_fees AS no_fees,
|
||||
IFNULL(SUM(IF(our_result='Y', 1, 0)), 0) AS valid,
|
||||
IFNULL(SUM(IF(our_result='N', 1, 0)), 0) AS invalid
|
||||
FROM $this->tableArchive AS s
|
||||
|
||||
1
sql/005_accounts_nofees.sql
Normal file
1
sql/005_accounts_nofees.sql
Normal file
@ -0,0 +1 @@
|
||||
ALTER TABLE `accounts` ADD `no_fees` BOOLEAN NOT NULL DEFAULT FALSE AFTER `is_anonymous` ;
|
||||
Loading…
Reference in New Issue
Block a user