-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Closed
Labels
Description
What steps will reproduce the problem?
Create query with AR using jsonb operators ?
, ?|
, ?&
(doc: https://www.postgresql.org/docs/9.4/static/functions-json.html)
Example:
$_arr = [9];
$q = Profile::find();
$q->andWhere(['?|', 'relationship', new Expression("array['$_arr']")]);
// $q->andWhere("$colName ?| array['$_arr']"); // even this type
$q->all();
What is the expected result?
Execution of SQL query like
SELECT * FROM "profile" WHERE "relationship" ?| array['9']
What do you get instead?
Execution of SQL query like
SELECT * FROM "profile" WHERE "relationship" $1| array['9']
Additional info
Q | A |
---|---|
Yii version | 2.0.15-dev |
PHP version | 7.1 |
Operating system | ubuntu16.04.1 |