/** * @before _secure * @after setDate */ public function campaign($id = null) { $this->seo(["title" => "Campaign Insights"]); $view = $this->getActionView(); $org = $this->org; $ad = Ad::first(['_id' => $id, 'org_id' => $org->_id]); if (!$ad) { $this->_404(); } $data = Shared\Services\Campaign::performance($id, ['start' => $this->start, 'end' => $this->end, 'pid' => $this->user_id, 'meta' => true]); $view->set('stats', $data['stats'])->set('total', $data['total']); }