@@ -2,8 +2,8 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Helpers; |
| 4 | 4 | |
| 5 | -class CheckRateable{ |
|
| 6 | - public static function checkRateable($content_type, $content_id, $user_id){ |
|
| 5 | +class CheckRateable { |
|
| 6 | + public static function checkRateable($content_type, $content_id, $user_id) { |
|
| 7 | 7 | $comments = \DB::table('comments') |
| 8 | 8 | ->selectRaw("SUM(comments.vote_up) as up, SUM(comments.vote_down) as down") |
| 9 | 9 | ->where('comments.content_id', '=', $content_id) |
@@ -11,9 +11,9 @@ discard block |
||
| 11 | 11 | ->where('comments.user_id', '=', $user_id) |
| 12 | 12 | ->first(); |
| 13 | 13 | |
| 14 | - if($comments->up > 0 || $comments->down > 0){ |
|
| 14 | + if ($comments->up > 0 || $comments->down > 0) { |
|
| 15 | 15 | return false; |
| 16 | - }else{ |
|
| 16 | + }else { |
|
| 17 | 17 | return true; |
| 18 | 18 | } |
| 19 | 19 | } |