Update LikeService, show like count to status owner
This commit is contained in:
parent
f47161fcd9
commit
4408e2ef8c
2 changed files with 9 additions and 2 deletions
|
@ -71,9 +71,16 @@ class LikeService {
|
||||||
|
|
||||||
$id = $like->profile_id;
|
$id = $like->profile_id;
|
||||||
|
|
||||||
return [
|
$res = [
|
||||||
'username' => ProfileService::get($id)['username'],
|
'username' => ProfileService::get($id)['username'],
|
||||||
'others' => $status->likes_count >= 5,
|
'others' => $status->likes_count >= 5,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if(request()->user()->profile_id == $status->profile_id) {
|
||||||
|
$res['total_count'] = $status->likes_count;
|
||||||
|
$res['total_count_pretty'] = number_format($res['total_count']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -228,7 +228,7 @@
|
||||||
<span class="like-count">Liked by
|
<span class="like-count">Liked by
|
||||||
<a class="font-weight-bold text-dark" :href="'/'+status.liked_by.username">{{status.liked_by.username}}</a>
|
<a class="font-weight-bold text-dark" :href="'/'+status.liked_by.username">{{status.liked_by.username}}</a>
|
||||||
<span v-if="status.liked_by.others == true">
|
<span v-if="status.liked_by.others == true">
|
||||||
and <span class="font-weight-bold">others</span>
|
and <span class="font-weight-bold" v-if="status.liked_by.total_count_pretty">{{status.liked_by.total_count_pretty}}</span> <span class="font-weight-bold">others</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue