Hi guys.I want to use two example Mark story in query.php in find count of comment and find count others.i mean this code
$query ->select(['total_comments_markstory' => $query->func()->count('Comments.id')]) ->leftJoinWith('Comments.Users', function ($q) { return $q->where(['username' => 'markstory']); ) ->group(['Users.id']);
$query ->select(['total_comments_john' => $query->func()->count('Comments.id')]) ->leftJoinWith('Comments.Users', function ($q) { return $q->where(['username' => 'john']); ) ->group(['Users.id']);
But this code find just john !. I am looking for run two of my queries.but it sounds just run last query.can you help me about this problem?.Thanks