Add secondary sort to auditions on Room model so that unassigned auditions will be sorted in score order.
Fixes #51
This commit is contained in:
parent
5aec942b4a
commit
12fae9ef30
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Events\AuditionChange;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
|
@ -17,7 +16,7 @@ class Room extends Model
|
|||
|
||||
public function auditions(): HasMany
|
||||
{
|
||||
return $this->hasMany(Audition::class)->orderBy('order_in_room');
|
||||
return $this->hasMany(Audition::class)->orderBy('order_in_room')->orderBy('score_order');
|
||||
}
|
||||
|
||||
public function entries(): HasManyThrough
|
||||
|
|
|
|||
Loading…
Reference in New Issue