public function __construct($organisationId) { parent::__construct($organisationId); $this->bandwidthTotal = ModelActivity::getBandwidthByDate($organisationId); $this->bandwidthMonth = ModelActivity::getBandwidthByDate($organisationId, date('01-m-Y')); $this->bandwidthTotal = ModelActivity::getBandwidthByDate($organisationId); $this->bandwidthToday = ModelActivity::getBandwidthByDate($organisationId, Date::toDate()); $this->bandwidthMonth = ModelActivity::getBandwidthByDate($organisationId, date('01-m-Y')); $this->bandwidthTotal = ModelActivity::getBandwidthByDate($organisationId); $this->masterImagesToday = ModelActivity::getMasterImagesBydate($organisationId, Date::toDate()); $this->masterImagesMonth = ModelActivity::getMasterImagesBydate($organisationId, date('01-m-Y')); $this->masterImagesTotal = ModelActivity::getMasterImagesBydate($organisationId); $this->rendersToday = ModelActivity::getRendersByDate($organisationId, Date::toDate()); $this->rendersMonth = ModelActivity::getRendersByDate($organisationId, date('01-m-Y'), date('01-m-Y')); $this->rendersTotal = ModelActivity::getRendersByDate($organisationId); if ($this->isPostBack()) { $action = strtolower($this->input('action')); if ($action === 'delete') { $this->organisation->deleted = !$this->organisation->deleted; } if ($action === 'disable') { $this->organisation->disabled = !$this->organisation->disabled; } $this->organisation->update(); $this->setMessage(lang('Organisation updated'), 'success'); response()->refresh(); } }
public function index() { $organisationId = request()->organisation->id; $bandwidthToday = ModelActivity::getBandwidthByDate($organisationId, Date::toDate()); $bandwidthTotal = ModelActivity::getBandwidthByDate($organisationId); $masterImagesToday = ModelActivity::getMasterImagesBydate($organisationId, Date::toDate()); $masterImagesTotal = ModelActivity::getMasterImagesBydate($organisationId); $rendersToday = ModelActivity::getRendersByDate($organisationId, Date::toDate()); $rendersTotal = ModelActivity::getRendersByDate($organisationId); response()->json(['bandwidth_today' => $bandwidthToday, 'bandwidth_total' => $bandwidthTotal, 'masterimages_today' => $masterImagesToday, 'masterimages_total' => $masterImagesTotal, 'renders_today' => $rendersToday, 'renders_total' => $rendersTotal]); }