THis is my core Mysql query
select * from
table_name
where CONCAT(',', subscriptions, ',') like '%,4793,%'
and i want to apply below filter on magento 2 collection. where CONCAT(',', subscriptions, ',') like '%,4793,%'
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityTHis is my core Mysql query
select * from
table_name
where CONCAT(',', subscriptions, ',') like '%,4793,%'
and i want to apply below filter on magento 2 collection. where CONCAT(',', subscriptions, ',') like '%,4793,%'
Use Zend_Db_Expr
Example:
$collection->getSelect()->where(new \Zend_Db_Expr("CONCAT(',', subscriptions, ',') LIKE (?)"), '%,4793,%');