fixed #9951: Matrix 2.0: Median not calculated correctly
This commit is contained in:
parent
1e38087d80
commit
814231b966
3 changed files with 35 additions and 1 deletions
|
|
@ -563,7 +563,7 @@ sub setRatings {
|
|||
|
||||
my $half = round($count/2);
|
||||
my $mean = $sum / ($count || 1);
|
||||
my $median = $db->quickScalar("select rating $sql limit $half,$half",[$self->getId,$category]);
|
||||
my $median = $db->quickScalar("select rating $sql order by rating limit $half,1",[$self->getId,$category]);
|
||||
|
||||
$db->write("replace into MatrixListing_ratingSummary
|
||||
(listingId, category, meanValue, medianValue, countValue, assetId)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue