mirror of
https://github.com/yiisoft/yii2.git
synced 2025-10-29 17:48:15 +08:00
Fix #17473: Fixed SimpleConditionBuilder::build() when column is not a string
This commit is contained in:
committed by
Alexander Makarov
parent
e615f0f43e
commit
69cf9de56b
@ -1201,6 +1201,7 @@ abstract class QueryBuilderTest extends DatabaseTestCase
|
||||
[['>=', 'date', new Expression('DATE_SUB(NOW(), INTERVAL 1 MONTH)')], '[[date]] >= DATE_SUB(NOW(), INTERVAL 1 MONTH)', []],
|
||||
[['>=', 'date', new Expression('DATE_SUB(NOW(), INTERVAL :month MONTH)', [':month' => 2])], '[[date]] >= DATE_SUB(NOW(), INTERVAL :month MONTH)', [':month' => 2]],
|
||||
[['=', 'date', (new Query())->select('max(date)')->from('test')->where(['id' => 5])], '[[date]] = (SELECT max(date) FROM [[test]] WHERE [[id]]=:qp0)', [':qp0' => 5]],
|
||||
[['=', new Expression('date'), '2019-08-01'], 'date = :qp0', [':qp0' => '2019-08-01']], // operand1 is Expression
|
||||
|
||||
// hash condition
|
||||
[['a' => 1, 'b' => 2], '([[a]]=:qp0) AND ([[b]]=:qp1)', [':qp0' => 1, ':qp1' => 2]],
|
||||
|
||||
Reference in New Issue
Block a user