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/extmag/shiplab/Plugin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/extmag/shiplab/Plugin/OrderLabelColumn.php
<?php
/**
 * Copyright © Extmag. All rights reserved.
 */

namespace Extmag\Shiplab\Plugin;

use Closure;
use Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory;

class OrderLabelColumn
{
    /**
     * @param CollectionFactory $subject
     * @param Closure $proceed
     * @param $requestName
     * @return mixed
     */
    public function aroundGetReport(
        CollectionFactory $subject,
        Closure $proceed,
        $requestName
    ) {
        $result = $proceed($requestName);
        if ($requestName == 'sales_order_grid_data_source') {
            $select = $result->getSelect();
            $select->joinLeft(
                ["ella" => $result->getResource()->getTable("extmag_labels")],
                'main_table.entity_id = ella.order_id AND ella.status=1',
                ['GROUP_CONCAT(ella.entity_id) AS extmag_shipping_label']
            )->distinct()->group('main_table.entity_id');
        } elseif ($requestName == 'sales_order_shipment_grid_data_source') {
            $select = $result->getSelect();
            $select->joinLeft(
                ["ella" => $result->getResource()->getTable("extmag_labels")],
                'main_table.entity_id = ella.order_sub_id AND ella.status=1 AND ella.order_sub_type="shipment"',
                ['GROUP_CONCAT(ella.entity_id) AS extmag_shipping_label']
            )->distinct()->group('main_table.entity_id');
        } elseif ($requestName == 'sales_order_creditmemo_grid_data_source') {
            $select = $result->getSelect();
            $select->joinLeft(
                ["ella" => $result->getResource()->getTable("extmag_labels")],
                'main_table.entity_id = ella.order_sub_id AND ella.status=1 AND ella.order_sub_type="refund"',
                ['GROUP_CONCAT(ella.entity_id) AS extmag_shipping_label']
            )->distinct()->group('main_table.entity_id');
        }

        return $result;
    }
}

Spamworldpro Mini