· 7 years ago · Dec 17, 2018, 01:50 PM
1public function __construct(
2 MagentoBackendAppActionContext $context,
3 MagentoFrameworkControllerResultJsonFactory $resultPageFactory,
4 MagentoFrameworkRegistry $registry,
5 MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
6 ) {
7 parent::__construct($context);
8 $this->resultPageFactory = $resultPageFactory;
9 $this->_registry = $registry;
10 $this->_resultLayoutFactory = $resultLayoutFactory;
11 }
12
13 public function execute()
14 {
15 if($this->getRequest()->isAjax()){
16 $start = $_POST['start'];
17 $end = $_POST['end'];
18
19 $enddate = date('Y-m-d 23:55:55', strtotime($end));
20 $startdate = date('Y-m-d 00:00:00', strtotime($start));
21 $resultLayout = $this->_resultLayoutFactory->create();
22 $response = $resultLayout->getLayout()->getBlock('MyModuleBlockdashboard')->getprocesseddata();
23 return $response;
24 }
25
26}
27
28public function __construct(
29 TemplateContext $context,
30 CardsManageFactory $cardsManageFactory,
31 Data $helperData,
32 array $data = [],
33 MagentoSalesModelResourceModelOrderCollectionFactory $orderCollectionFactory,
34
35 MagentoCatalogModelCategoryFactory $categoryFactory,
36 MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
37 MagentoBackendModelSession $session,
38 MagentoFrameworkRegistry $registry
39 )
40 {
41
42 $this->_orderCollectionFactory = $orderCollectionFactory;
43 $this->_categoryFactory = $categoryFactory;
44
45 parent::__construct($context, $data);
46
47 $this->_cardsManageFactory = $cardsManageFactory;
48 $this->_helperData = $helperData;
49 $this->scopeConfig = $scopeConfig; // get api_key and secret_key
50 $this->session = $session;
51 $this->_registry = $registry;
52 }
53
54 public function getprocesseddata()
55 {
56 return 1;
57}