Commit e6ff5d37 by xiongyuwen

no message

parent 8f705622
......@@ -108,11 +108,18 @@ class ListNotificationController extends AbstractListController
public function search(User $actor, $filter, $limit = null, $offset = 0)
{
$type = Arr::get($filter, 'type');
$isNotRead = Arr::get($filter, 'isNotRead');
$query = $actor->notifications()
->when($type, function ($query, $type) {
return $query->whereIn('type', explode(',', $type));
});
if($isNotRead=="1")
{
$query->where('read_at', '=', null);
}
$query->orderBy('created_at', 'desc');
$this->notificationCount = $limit > 0 ? $query->count() : null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment