notification & notes wip
This commit is contained in:
1 parent
94a3c6c472
commit
155177045b
30 files changed
+426
-320
No files matched your search
+10
-5
@@ -53,11 +53,6 @@ class Event extends Model
|
||||
return $this->belongsTo(Group::class);
|
||||
}
|
||||
|
||||
public function user_notes()
|
||||
{
|
||||
return $this->hasMany(UserNote::class, 'event_id', 'id');
|
||||
}
|
||||
|
||||
public function competition_group()
|
||||
{
|
||||
return $this->belongsTo(CompetitionGroup::class);
|
||||
@@ -148,6 +143,16 @@ class Event extends Model
|
||||
return $this->hasOne(EventUserStar::class, 'event_id', 'id');
|
||||
}
|
||||
|
||||
public function event_user_note()
|
||||
{
|
||||
return $this->hasMany(EventUserNote::class, 'event_id', 'id');
|
||||
}
|
||||
|
||||
public function event_user_notification()
|
||||
{
|
||||
return $this->hasMany(EventUserNotification::class, 'event_id', 'id');
|
||||
}
|
||||
|
||||
public function event_bookmaker()
|
||||
{
|
||||
return $this->hasOne(EventBookmaker::class, 'event_id', 'id')->where('bookmaker_id', auth()->user()->bookmaker_id);
|
||||
|
||||
@@ -5,10 +5,9 @@ namespace App\Models;
|
||||
use App\Models\Scopes\ClientScope;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UserNote extends Model
|
||||
class EventUserNote extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'user_messageid',
|
||||
'event_id',
|
||||
'bookmaker_id',
|
||||
'user_id',
|
||||
@@ -4,13 +4,16 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UserNotification extends Model
|
||||
class EventUserNotification extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'event_id',
|
||||
'bookmaker_id',
|
||||
'user_id',
|
||||
'message',
|
||||
'odds_table_id',
|
||||
'alarm_level_id',
|
||||
'notify_by_email',
|
||||
'is_notified',
|
||||
'deleted',
|
||||
];
|
||||
|
||||
@@ -30,4 +30,21 @@ class OddsTable extends Model
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
public static function options_sport()
|
||||
{
|
||||
switch (auth()->user()->sport_id) {
|
||||
case 1:
|
||||
return OddsTable::where('soccer', 1)->pluck('fulltitle', 'id');
|
||||
case 2:
|
||||
return OddsTable::where('icehockey', 1)->pluck('fulltitle', 'id');
|
||||
case 3:
|
||||
return OddsTable::where('basketball', 1)->pluck('fulltitle', 'id');
|
||||
case 5:
|
||||
return OddsTable::where('tennis', 1)->pluck('fulltitle', 'id');
|
||||
}
|
||||
|
||||
return [];
|
||||
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -34,7 +34,9 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication
|
||||
'app_verified_at',
|
||||
'client_id',
|
||||
'sport_id',
|
||||
'star',
|
||||
'filter_stars',
|
||||
'filter_notes',
|
||||
'filter_notification',
|
||||
'is_multiline_direct',
|
||||
'all_only_none',
|
||||
'partner_show',
|
||||
|
||||
Reference in new issue
Block a user