Total Complexity | 6 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class Leaderboard extends Model |
||
9 | { |
||
10 | |||
11 | protected $guarded = []; |
||
12 | |||
13 | protected $appends = ['currentTimescope']; |
||
14 | |||
15 | public static function findByGameId($gameId) |
||
18 | } |
||
19 | |||
20 | public function timescopes() |
||
21 | { |
||
22 | return $this->hasMany(LeaderboardTimescope::class); |
||
23 | } |
||
24 | |||
25 | public function scoreSumRewards() |
||
26 | { |
||
27 | return $this->hasMany(LeaderboardReward::class)->whereNotNull('score_sum')->orderBy('score_sum', 'desc')->get(); |
||
28 | } |
||
29 | |||
30 | public function scoreSumRankRewards() |
||
33 | } |
||
34 | |||
35 | public function highscoreRankRewards() |
||
36 | { |
||
37 | return $this->hasMany(LeaderboardReward::class)->whereNotNull('highscore_rank')->orderBy('highscore_rank')->get(); |
||
38 | } |
||
39 | |||
40 | public function getCurrentTimescopeAttribute() |
||
43 | } |
||
44 | |||
45 | } |