Ui/DataProvider/Grid/Account/Query.php
protected function getQueryItems()
    {
        /* this is primary query builder, not extender */
        $result = parent::getQueryItems();

        /* define tables aliases for internal usage (in this method) */
        $asDwnl = self::AS_DWNL;
        $asAcc = self::AS_ACCOUNT;

        /* LEFT JOIN prxgt_dwnl_customer */
        $tbl = $this->resource->getTableName(EDownline::ENTITY_NAME);
        $as = $asDwnl;
        $cols = [
            self::A_MLM_ID => EDownline::A_MLM_ID
        ];
        $cond = $as . '.' . EDownline::A_CUSTOMER_REF . '=' . $asAcc . '.' . EAccount::A_CUST_ID;
        $result->joinLeft([$as => $tbl], $cond, $cols);

        /* return  result */
        return $result;
    }
protected function getQueryItems()
    {
        /* this is primary query builder, not extender */
        $result = parent::getQueryItems();

        /* define tables aliases for internal usage (in this method) */
        $asDwnl = self::AS_DWNL;
        $asAcc = self::AS_ACCOUNT;

        /* LEFT JOIN prxgt_dwnl_customer */
        $tbl = $this->resource->getTableName(EDownline::ENTITY_NAME);
        $as = $asDwnl;
        $cols = [
            self::A_MLM_ID => EDownline::A_MLM_ID
        ];
        $cond = $as . '.' . EDownline::A_CUSTOMER_REF . '=' . $asAcc . '.' . EAccount::A_CUST_ID;
        $result->joinLeft([$as => $tbl], $cond, $cols);

        /* return  result */
        return $result;
    }
protected function getQueryItems ( ) { /* this is primary query builder, not extender */ $ result = parent :: getQueryItems ( ) ; /* define tables aliases for internal usage (in this method) */ $ asDwnl = self :: AS_DWNL ; $ asAcc = self :: AS_ACCOUNT ; /* LEFT JOIN prxgt_dwnl_customer */ $ tbl = $ this -> resource -> getTableName ( EDownline :: ENTITY_NAME ) ; $ as = $ asDwnl ; $ cols = [ self :: A_MLM_ID => EDownline :: A_MLM_ID ] ; $ cond = $ as . '.' . EDownline :: A_CUSTOMER_REF . '=' . $ asAcc . '.' . EAccount :: A_CUST_ID ; $ result -> joinLeft ( [ $ as => $ tbl ] , $ cond , $ cols ) ; /* return  result */ return $ result ; }
SELECT
...
FROM
`prxgt_acc_account` AS `paa`
LEFT JOIN `prxgt_acc_type_asset` AS `pata` ON
pata.id = paa.asset_type_id
LEFT JOIN `customer_entity` AS `ce` ON
ce.entity_id = paa.customer_id
LEFT JOIN `prxgt_dwnl_customer` AS `dwnl` ON
dwnl.customer_ref = paa.customer_id
SELECT ... FROM prxgt_acc_account AS paa LEFT JOIN prxgt_acc_type_asset AS pata ON pata . id = paa . asset_type_id LEFT JOIN customer_entity AS ce ON ce . entity_id = paa . customer_id LEFT JOIN prxgt_dwnl_customer AS dwnl ON dwnl . customer_ref = paa . customer_id