Skip to content

Commit ce265f6

Browse files
committed
Checked aggregate
1 parent 87ee130 commit ce265f6

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/Models/Rating.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,13 @@ public function updateRating($id, $data)
8383
*
8484
* @return mixed
8585
*/
86-
public function getAllRatings($id, $paginate, $perPage, $sort = 'desc')
86+
public function getAllRatings($id, $sort = 'desc')
8787
{
88-
if($paginate){
89-
$rating = $this->select('*')
90-
->where('reviewrateable_id', $id)
91-
->orderBy('created_at', $sort)
92-
->paginate($perPage);
93-
}else{
94-
$rating = $this->select('*')
88+
$rating = $this->select('*')
9589
->where('reviewrateable_id', $id)
9690
->orderBy('created_at', $sort)
9791
->get();
98-
}
92+
9993
return $rating;
10094
}
10195

src/Traits/ReviewRateable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,9 @@ public function updateRating($id, $data, Model $parent = null)
296296
*
297297
* @return mixed
298298
*/
299-
public function getAllRatings($id, $paginate = false, $perPage = 5, $sort = 'desc')
299+
public function getAllRatings($id, $sort = 'desc')
300300
{
301-
return (new Rating())->getAllRatings($id, $paginate, $perPage, $sort);
301+
return (new Rating())->getAllRatings($id, $sort);
302302
}
303303

304304
/**

0 commit comments

Comments
 (0)