Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/magento/module-backend/Controller/Adminhtml/Dashboard/Chart/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/corals/old/vendor/magento/module-backend/Controller/Adminhtml/Dashboard/Chart/Amounts.php
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
declare(strict_types=1);

namespace Magento\Backend\Controller\Adminhtml\Dashboard\Chart;

use Magento\Backend\App\Action\Context;
use Magento\Backend\Controller\Adminhtml\Dashboard;
use Magento\Backend\Model\Dashboard\Chart;
use Magento\Framework\App\Action\HttpPostActionInterface;
use Magento\Framework\Controller\Result\Json;
use Magento\Framework\Controller\Result\JsonFactory;

/**
 * Get order amounts chart data controller
 */
class Amounts extends Dashboard implements HttpPostActionInterface
{
    /**
     * @var JsonFactory
     */
    private $resultJsonFactory;

    /**
     * @var Chart
     */
    private $chart;

    /**
     * Amounts constructor.
     *
     * @param Context $context
     * @param JsonFactory $resultJsonFactory
     * @param Chart $chart
     */
    public function __construct(
        Context $context,
        JsonFactory $resultJsonFactory,
        Chart $chart
    ) {
        parent::__construct($context);
        $this->resultJsonFactory = $resultJsonFactory;
        $this->chart = $chart;
    }

    /**
     * Get chart data
     *
     * @return Json
     */
    public function execute(): Json
    {
        $data = [
            'data' => $this->chart->getByPeriod(
                $this->_request->getParam('period'),
                'revenue',
                $this->_request->getParam('store'),
                $this->_request->getParam('website'),
                $this->_request->getParam('group')
            ),
            'label' => __('Revenue')
        ];

        return $this->resultJsonFactory->create()
            ->setData($data);
    }
}

Spamworldpro Mini