mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-29 17:53:16 +00:00
Update Profile model
This commit is contained in:
parent
60923af897
commit
b92cc8f41e
1 changed files with 6 additions and 1 deletions
|
@ -143,7 +143,11 @@ class Profile extends Model
|
||||||
|
|
||||||
public function statusCount()
|
public function statusCount()
|
||||||
{
|
{
|
||||||
return $this->statuses()->whereHas('media')->count();
|
return $this->statuses()
|
||||||
|
->whereHas('media')
|
||||||
|
->whereNull('in_reply_to_id')
|
||||||
|
->whereNull('reblog_of_id')
|
||||||
|
->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function recommendFollowers()
|
public function recommendFollowers()
|
||||||
|
@ -159,6 +163,7 @@ class Profile extends Model
|
||||||
->whereNotIn('following_id', $follows)
|
->whereNotIn('following_id', $follows)
|
||||||
->whereIn('profile_id', $following)
|
->whereIn('profile_id', $following)
|
||||||
->orderByRaw('rand()')
|
->orderByRaw('rand()')
|
||||||
|
->distinct('id')
|
||||||
->limit(3)
|
->limit(3)
|
||||||
->pluck('following_id');
|
->pluck('following_id');
|
||||||
$recommended = [];
|
$recommended = [];
|
||||||
|
|
Loading…
Reference in a new issue