Skip to content

Commit cfdd3a1

Browse files
committed
Reverted
1 parent 74bcd11 commit cfdd3a1

File tree

3 files changed

+0
-41
lines changed

3 files changed

+0
-41
lines changed

src/Contracts/ReviewRateable.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,4 @@ public function deleteRating($id);
180180
* @return mixed
181181
*/
182182
public function getUserRatings($id, $author, $sort = 'desc');
183-
184-
/**
185-
*
186-
* @param $round
187-
* @return double
188-
*/
189-
public function averageRatingForAll($round = null);
190183
}

src/Models/Rating.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -213,28 +213,4 @@ public function getUserRatings($id, $author, $sort = 'desc')
213213

214214
return $rating;
215215
}
216-
217-
/**
218-
* @param $id
219-
*
220-
* @return mixed
221-
*/
222-
public function getAverageRatingForAll($round = null, $onlyApproved = false)
223-
{
224-
$where = $onlyApproved ? [['approved', '1']] : [];
225-
$avgExpression = null;
226-
227-
if ($round) {
228-
$avgExpression = 'ROUND(AVG(rating), ' . $round . ') as averageReviewRateable';
229-
} else {
230-
$avgExpression = 'AVG(rating) as averageReviewRateable';
231-
}
232-
233-
return $this->ratings()
234-
->selectRaw($avgExpression)
235-
->where($where)
236-
->get()
237-
->first()
238-
->averageReviewRateable;
239-
}
240216
}

src/Traits/ReviewRateable.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -382,14 +382,4 @@ public function getUserRatings($id, $author, $sort = 'desc')
382382
{
383383
return (new Rating())->getUserRatings($id, $author, $sort = 'desc');
384384
}
385-
386-
/**
387-
* @param $id
388-
*
389-
* @return mixed
390-
*/
391-
public function averageRatingForAll($round = null, $onlyApproved = false)
392-
{
393-
return (new Rating())->getAverageRatingForAll($round, $onlyApproved);
394-
}
395385
}

0 commit comments

Comments
 (0)