Award combo rule now counts types of badges, not just count
This commit is contained in:
parent
4e924eb1b0
commit
f1079beaa6
@ -19,14 +19,14 @@ class AwardCombo implements YagaRule {
|
|||||||
$TargetDate = strtotime($Criteria->Duration . ' ' . $Criteria->Period . ' ago');
|
$TargetDate = strtotime($Criteria->Duration . ' ' . $Criteria->Period . ' ago');
|
||||||
$Badges = $BadgeModel->GetUserBadgeAwards($UserID);
|
$Badges = $BadgeModel->GetUserBadgeAwards($UserID);
|
||||||
|
|
||||||
$Count = 0;
|
$Types = array();
|
||||||
foreach($Badges as $Badge) {
|
foreach($Badges as $Badge) {
|
||||||
if(strtotime($Badge['DateInserted']) >= $TargetDate) {
|
if(strtotime($Badge['DateInserted']) >= $TargetDate) {
|
||||||
$Count++;
|
$Types[$Badge['RuleClass']] = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($Count >= $Target) {
|
if(count($Types) >= $Target) {
|
||||||
return $UserID;
|
return $UserID;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -41,7 +41,7 @@ class AwardCombo implements YagaRule {
|
|||||||
'year' => 'Years'
|
'year' => 'Years'
|
||||||
);
|
);
|
||||||
|
|
||||||
$String = $Form->Label('Number of Badges', 'AwardCombo');
|
$String = $Form->Label('Number of Badge Types', 'AwardCombo');
|
||||||
$String .= $Form->Textbox('Target');
|
$String .= $Form->Textbox('Target');
|
||||||
$String .= $Form->Label('Time Frame');
|
$String .= $Form->Label('Time Frame');
|
||||||
$String .= $Form->Textbox('Duration');
|
$String .= $Form->Textbox('Duration');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user