Answer the question
In order to leave comments, you need to log in
Question mark? in an ActiveRecord query?
I'm writing a filter for the site. The database is PostgreSQL.
On get parameters I write conditions of selection.
$languageFilter = ActiveRecord::find();
$languageFilter->andWhere('"p"."field_id" = 17');
try {
$languageFilter->andWhere('"p"."value"::jsonb ?| array' . str_replace('"', "'", (string) Json::encode($filterGetData['language'])));
} catch (InvalidParamException $e) {
throw new UnprocessableEntityHttpException();
}
$resumeFind->andWhere($languageFilter->where);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question