<?php
ini_set('display_errors', 1);
ini_set('memory_limit', '160000M');
ini_set('max_execution_time', 0);
use MagentoFrameworkAppBootstrap;
require __DIR__ . '/app/bootstrap.php';
$params = $_SERVER;
$bootstrap = Bootstrap::create(BP, $params);
$obj = $bootstrap->getObjectManager();
$state = $obj->get('MagentoFrameworkAppState');
$state->setAreaCode('frontend');
$order_coll = $obj->get('MagentoSalesModelOrder')->getCollection();
$order_coll->getSelect()
->join(array('order_item' => 'sales_order_item'),
'order_item.order_id = main_table.entity_id',getColumns('sales_order_item', 'soi_'));
$order_coll->getSelect()
->join(array('sales_grid'=>'sales_order_grid'),
'sales_grid.entity_id=main_table.entity_id',getColumns('sales_order_grid','sog_'));
foreach ($order_coll as $entity) {
echo "<pre>";
print_r($entity->getData());
echo "</pre>";
}
function getColumns($table,$prefix)
{
$resource = $GLOBALS['obj']->get('MagentoFrameworkAppResourceConnection');
$connection = $resource->getConnection();
$sql = "SHOW COLUMNS FROM `$table`;";
$result = $connection->fetchAll($sql);
$columns = array();
for ($i = 0; $i < count($result); $i++) {
array_push($columns,$result[$i]['Field']." as ".$prefix.$result[$i]['Field']);
}
return $columns;
}
?>
Code Example |
---|
Php :: dispatch job with queue name in laravel |
Php :: url segment in laravel |
Php :: ?? Null Coalescing Operator PHP |
Php :: define php |
Php :: laravel has many |
Php :: laravel phpdoc collection of model |
Php :: laravel blade components |
Php :: php get current page url |
Php :: Advanced Custom Fields get sub field image |
Php :: echo errors php |
Php :: php random filename generator |
Php :: html pagination php |
Php :: laravel where 2 column |
Php :: php declare array |
Php :: laravel module package |
Php :: isset laravel |
Php :: continue in php |
Php :: How to display custom field in wordpress? |
Php :: load session in codeigniter |
Php :: array marge in php |
Php :: php array serialize |
Php :: count column eloquent laravel |
Php :: smarty switch case |
Php :: naming the routes in laravel |
Php :: getimagesize php |
Php :: remove invalid characters from a string laravel |
Php :: php aes |
Php :: laravel notification |
Php :: rendering json in laravel |
Php :: how do i know if file is empty in php |