| Conditions | 3 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 6 | { |
||
| 7 | public static function checkRateable($content_type, $content_id, $user_id) |
||
| 8 | { |
||
| 9 | $comments = \DB::table('comments') |
||
| 10 | ->selectRaw('SUM(comments.vote_up) as up, SUM(comments.vote_down) as down') |
||
| 11 | ->where('comments.content_id', '=', $content_id) |
||
| 12 | ->where('comments.content_type', '=', $content_type) |
||
| 13 | ->where('comments.user_id', '=', $user_id) |
||
| 14 | ->first(); |
||
| 15 | |||
| 16 | if ($comments->up > 0 || $comments->down > 0) { |
||
| 17 | return false; |
||
| 18 | } else { |
||
| 19 | return true; |
||
| 20 | } |
||
| 23 |