mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 06:03:39 +08:00
Avoid usage of facade in user model
This commit is contained in:
parent
9f01a60243
commit
caf8e29852
|
@ -3,7 +3,6 @@
|
||||||
use Illuminate\Contracts\Hashing\Hasher;
|
use Illuminate\Contracts\Hashing\Hasher;
|
||||||
use Tobscure\Permissible\Permissible;
|
use Tobscure\Permissible\Permissible;
|
||||||
use Flarum\Core\Formatter\FormatterManager;
|
use Flarum\Core\Formatter\FormatterManager;
|
||||||
use Flarum\Core\Exceptions\InvalidConfirmationTokenException;
|
|
||||||
use Flarum\Core\Events\UserWasDeleted;
|
use Flarum\Core\Events\UserWasDeleted;
|
||||||
use Flarum\Core\Events\UserWasRegistered;
|
use Flarum\Core\Events\UserWasRegistered;
|
||||||
use Flarum\Core\Events\UserWasRenamed;
|
use Flarum\Core\Events\UserWasRenamed;
|
||||||
|
@ -323,7 +322,7 @@ class User extends Model
|
||||||
->whereIn('type', array_filter($types, [$this, 'shouldAlert']))
|
->whereIn('type', array_filter($types, [$this, 'shouldAlert']))
|
||||||
->where('time', '>', $this->notification_read_time ?: 0)
|
->where('time', '>', $this->notification_read_time ?: 0)
|
||||||
->where('is_read', 0)
|
->where('is_read', 0)
|
||||||
->count(\DB::raw('DISTINCT type, subject_id'));
|
->count($this->getConnection()->raw('DISTINCT type, subject_id'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPreferencesAttribute($value)
|
public function getPreferencesAttribute($value)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user