Magento 2 : Create mysql query Join
class Collection extends AbstractCollection
{
protected function _construct(
)
{
parent::_construct();
$this->_init(SellerOperationTeamList::class , SellerOperationTeam::class);
}
protected function _initSelect()
{
parent::_initSelect();
$this->getSelect()->joinLeft(
['customer_address_entity' => $this->getTable('customer_address_entity')],
'`main_table`.address_id = `customer_address_entity`.entity_id',['city','region','postcode' ,'street' , 'region_id','country_id']
)->join(
['seller_operation_team_role' => $this->getTable('seller_operation_team_role')],
'`main_table`.seller_operation_team_role_id = `seller_operation_team_role`.id',['name']
);
$this->addFilterToMap('name', 'main_table.seller_operation_team_role_id');
}
}