Calculate ratings, even is the count is less than 10.
This commit is contained in:
parent
f2b7762ddd
commit
fc4dca65e1
1 changed files with 3 additions and 5 deletions
|
|
@ -608,11 +608,9 @@ sub setRatings {
|
|||
my $mean = $sum / ($count || 1);
|
||||
my $median = $db->quickScalar("select rating $sql order by rating limit $half,1",[$self->getId,$category]);
|
||||
|
||||
if ($count >= 10) {
|
||||
$db->write("replace into MatrixListing_ratingSummary
|
||||
(listingId, category, meanValue, medianValue, countValue, assetId)
|
||||
values (?,?,?,?,?,?)",[$self->getId,$category,$mean,$median,$count,$matrixId]);
|
||||
}
|
||||
$db->write("replace into MatrixListing_ratingSummary
|
||||
(listingId, category, meanValue, medianValue, countValue, assetId)
|
||||
values (?,?,?,?,?,?)",[$self->getId,$category,$mean,$median,$count,$matrixId]);
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue