Ui/DataProvider/Grid/Account/Query.php
protected function getQueryItems()
    {
        $result = $this->conn->select();

        /* define tables aliases for internal usage (in this method) */
        $asAcc = self::AS_ACCOUNT;
        $asCust = self::AS_CUSTOMER;
        $asAsset = self::AS_TYPE_ASSET;

        /* SELECT FROM prxgt_acc_account */
        $tbl = $this->resource->getTableName(EAccount::ENTITY_NAME);
        $as = $asAcc;
        $cols = [
            self::A_ID => EAccount::A_ID,
            self::A_BALANCE => EAccount::A_BALANCE
        ];
        $result->from([$as => $tbl], $cols);

        /* LEFT JOIN prxgt_acc_type_asset */
        $tbl = $this->resource->getTableName(ETypeAsset::ENTITY_NAME);
        $as = $asAsset;
        $cols = [
            self::A_ASSET => ETypeAsset::A_CODE
        ];
        $cond = $as . '.' . ETypeAsset::A_ID . '=' . $asAcc . '.' . EAccount::A_ASSET_TYPE_ID;
        $result->joinLeft([$as => $tbl], $cond, $cols);

        /* LEFT JOIN customer_entity */
        $tbl = $this->resource->getTableName(Cfg::ENTITY_MAGE_CUSTOMER);
        $as = $asCust;
        $exp = $this->getExpForCustName();
        $cols = [
            self::A_CUST_NAME => $exp,
            self::A_CUST_EMAIL => Cfg::E_CUSTOMER_A_EMAIL,
            self::A_CUST_ID => Cfg::E_CUSTOMER_A_ENTITY_ID
        ];
        $cond = $as . '.' . Cfg::E_CUSTOMER_A_ENTITY_ID . '=' . $asAcc . '.' . EAccount::A_CUST_ID;
        $result->joinLeft([$as => $tbl], $cond, $cols);

        /* return  result */
        return $result;
    }
protected function getQueryItems()
    {
        $result = $this->conn->select();

        /* define tables aliases for internal usage (in this method) */
        $asAcc = self::AS_ACCOUNT;
        $asCust = self::AS_CUSTOMER;
        $asAsset = self::AS_TYPE_ASSET;

        /* SELECT FROM prxgt_acc_account */
        $tbl = $this->resource->getTableName(EAccount::ENTITY_NAME);
        $as = $asAcc;
        $cols = [
            self::A_ID => EAccount::A_ID,
            self::A_BALANCE => EAccount::A_BALANCE
        ];
        $result->from([$as => $tbl], $cols);

        /* LEFT JOIN prxgt_acc_type_asset */
        $tbl = $this->resource->getTableName(ETypeAsset::ENTITY_NAME);
        $as = $asAsset;
        $cols = [
            self::A_ASSET => ETypeAsset::A_CODE
        ];
        $cond = $as . '.' . ETypeAsset::A_ID . '=' . $asAcc . '.' . EAccount::A_ASSET_TYPE_ID;
        $result->joinLeft([$as => $tbl], $cond, $cols);

        /* LEFT JOIN customer_entity */
        $tbl = $this->resource->getTableName(Cfg::ENTITY_MAGE_CUSTOMER);
        $as = $asCust;
        $exp = $this->getExpForCustName();
        $cols = [
            self::A_CUST_NAME => $exp,
            self::A_CUST_EMAIL => Cfg::E_CUSTOMER_A_EMAIL,
            self::A_CUST_ID => Cfg::E_CUSTOMER_A_ENTITY_ID
        ];
        $cond = $as . '.' . Cfg::E_CUSTOMER_A_ENTITY_ID . '=' . $asAcc . '.' . EAccount::A_CUST_ID;
        $result->joinLeft([$as => $tbl], $cond, $cols);

        /* return  result */
        return $result;
    }
SELECT
`paa`.`id`,
`paa`.`balance`,
`prxgt_acc_type_asset`.`code` AS `asset`,
(CONCAT(firstname, ' ', lastname)) AS `custName`,
`ce`.`email` AS `custEmail`
FROM `prxgt_acc_account` AS `paa`
LEFT JOIN `prxgt_acc_type_asset`
ON pata.id = paa.asset_type_id
LEFT JOIN `customer_entity` AS `ce`
ON ce.entity_id = paa.customer_id