|
@@ -42,8 +42,8 @@ class GoodsRateService extends CrudService {
|
|
|
const length = arr.length;
|
|
|
let mid,
|
|
|
midIndex;
|
|
|
- const wl = [],
|
|
|
- gl = [];
|
|
|
+ const gl = [];
|
|
|
+ let wl = [];
|
|
|
if (length % 2 !== 0) {
|
|
|
midIndex = this.ctx.plus(Math.floor(length / 2), 1);
|
|
|
mid = arr[midIndex];
|
|
@@ -56,9 +56,7 @@ class GoodsRateService extends CrudService {
|
|
|
else wl.push(i);
|
|
|
}
|
|
|
const offset = _.floor(this.ctx.divide(gl.length, 10));
|
|
|
- for (let i = 0; i < offset.length; i++) {
|
|
|
- wl.pop();
|
|
|
- }
|
|
|
+ wl = wl.splice(1, offset);
|
|
|
score = this.ctx.minus(score, this.ctx.multiply(wl.length, 0.01));
|
|
|
return score;
|
|
|
}
|