Skip to content

Commit

Permalink
fix the count of unstructured posts in source
Browse files Browse the repository at this point in the history
  • Loading branch information
Mh-Asmi committed Apr 29, 2024
1 parent 2325082 commit cb369dd
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,10 @@ private function getGroupedTotals(PostStatsSearchFields $search)
}

if ($search->enableGroupBySource()) {
$search_query->selectRaw('COALESCE(posts.source, MAX(messages.type), "web") as source');
// TO DO : need to redo when updqte the source handling
$search_query->selectRaw('COALESCE(posts.source, messages.type, "web") as source');
$search_query->groupBy('posts.source');
$search_query->groupBy('messages.type');
} else {
$search_query->selectRaw('MAX("all") as source');
}
Expand Down Expand Up @@ -597,10 +599,8 @@ private function getUnstructuredPostsTotal(PostStatsSearchFields $search)
{

// unset form
//$updated_search = $search;
//$updated_search->setFormCondition("null");
$search_query = $this->getMainSearchQuery($search, true);
$search_query->rightJoin('post_point', 'post_point.post_id', 'posts.id');
$search_query->whereNull('posts.form_id');
$Unstructured = $search_query->first()->total;

return $Unstructured;
Expand Down

0 comments on commit cb369dd

Please sign in to comment.