Skip to content

Commit

Permalink
cs
Browse files Browse the repository at this point in the history
  • Loading branch information
jbouzekri committed Jul 31, 2014
1 parent 3e89f15 commit 9c091e4
Showing 1 changed file with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,26 @@ public function getGambleProcessedStats(User $user)

$qb = $this->createQueryBuilder()
->field('user.id')->equals($user->getId())
->map('function() {
if (typeof this.processedDate == "undefined") {
emit("unprocessed", 1);
} else if (this.winner === true) {
emit("winner", 1);
} else if (this.winner === false) {
emit("loser", 1);
}
}')
->reduce('function(k, vals) {
var sum = 0;
for (var i in vals) {
sum += vals[i];
}
return sum;
}');
->map(
'function() {
if (typeof this.processedDate == "undefined") {
emit("unprocessed", 1);
} else if (this.winner === true) {
emit("winner", 1);
} else if (this.winner === false) {
emit("loser", 1);
}
}'
)
->reduce(
'function(k, vals) {
var sum = 0;
for (var i in vals) {
sum += vals[i];
}
return sum;
}'
);

try {
$mapResults = $qb->getQuery()->execute();
Expand Down

0 comments on commit 9c091e4

Please sign in to comment.