raw('count(' . $wpdb->prefix . 'fluentform_submissions.id) as total'), wpFluent()->raw('max(' . $wpdb->prefix . 'fluentform_submissions.id) as max_id'), ]) ->orderBy('max_id', 'DESC') ->groupBy('fluentform_submissions.form_id') ->join('fluentform_forms', 'fluentform_forms.id', '=', 'fluentform_submissions.form_id') ->limit(10) ->get(); if (!$stats) { echo 'You can see your submission stats here'; return; } foreach ($stats as $stat) { $stat->unreadCount = Helper::unreadCount($stat->form_id); } $this->printStats($stats); return; } private function printStats($stats) { ?>