Skip to content

Commit

Permalink
update on condition in source filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Mh-Asmi committed May 17, 2024
1 parent 49dff9a commit 520b203
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ private function setSearchCondition(PostSearchFields $search_fields, $query, boo

if (count($search_fields->source())) {
$this->filter_joined_tables[] = 'messages';
$query->leftJoin("messages", 'posts.id', '=', 'messages.post_id');

$query->leftJoin('messages', function ($join) {
$join->on('posts.id', '=', 'messages.post_id');
$join->where('messages.direction', '=', "incoming");
});
if ($search_fields->webSource()) {
$query->where(function ($builder) use ($search_fields) {
$builder->whereNull('messages.type')
Expand All @@ -222,7 +226,6 @@ private function setSearchCondition(PostSearchFields $search_fields, $query, boo
}
});
}
$query->where("messages.direction", "incoming");
}

if ($search_fields->hasLocation() === 'mapped') {
Expand Down

0 comments on commit 520b203

Please sign in to comment.