Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | public function getTycoons($world_id, $initial = null) |
||
28 | { |
||
29 | if (!empty($initial)) { |
||
30 | return Tycoon::where('name', 'like', $initial . '%') |
||
31 | ->leftjoin('worlds_tycoons', 'tycoons.id', '=', 'worlds_tycoons.id') |
||
32 | ->where('worlds_tycoons.world_id', $world_id) |
||
33 | ->get(); |
||
34 | |||
35 | } else { |
||
36 | return World::where('id', $world_id)->with('tycoons.tycoon')->get(); |
||
37 | } |
||
40 | } |