fix some bugs from accounting 9
This commit is contained in:
@@ -19,6 +19,7 @@ class AppNotification extends Model
|
||||
'severity',
|
||||
'is_active',
|
||||
'created_by',
|
||||
'is_system',
|
||||
'audience_type',
|
||||
'segment_keys',
|
||||
'audience_label',
|
||||
@@ -27,10 +28,22 @@ class AppNotification extends Model
|
||||
|
||||
protected $casts = [
|
||||
'is_active' => 'boolean',
|
||||
'is_system' => 'boolean',
|
||||
'segment_keys' => 'array',
|
||||
'recipients_count' => 'integer',
|
||||
];
|
||||
|
||||
/** اعلان تراکنشی خودکار (نه ارسال دستی ادمین) */
|
||||
public function scopeSystem($query)
|
||||
{
|
||||
return $query->where('is_system', true);
|
||||
}
|
||||
|
||||
public function scopeAdminCreated($query)
|
||||
{
|
||||
return $query->where('is_system', false);
|
||||
}
|
||||
|
||||
public function reads(): HasMany
|
||||
{
|
||||
return $this->hasMany(AppNotificationRead::class, 'notification_id');
|
||||
|
||||
Reference in New Issue
Block a user