M
M
Maxim Shadrin2019-01-22 17:48:53
MODX
Maxim Shadrin, 2019-01-22 17:48:53

How to rewrite a complex where condition on fenom?

Hello.
The prehistory is such that there is a tv field of type selection from a list (several options)
In the database, such a record is stored as a string with a separator || between values. For example 26||13
Problems arise when you need to filter the selection by this condition. But, this problem has already been solved by one person. here is his solution: https://modx.pro/development/7236
But, he uses the standard modox parser, and I'm a phenom, and I can't figure out how to write this condition in the phenom syntax.

&where = `["1 = 1 AND FIND_IN_SET('321596', replace(season_tickets, '||', ','))"]`

Maybe someone has already done this?
So far, I've inserted the snippet call the old way, using the modox parser.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maniiii, 2019-01-22
@maniiii

Something like that probably.

'where' => ["1 = 1 AND FIND_IN_SET('"~$id~"', replace(season_tickets, '||', ','))"],

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question