-2

i think this can be a bug in yii2, when i use:

$query->select ("isnull(cba.HSLET,0)");
$query->join('INNER JOIN','cba','cba.id = regverification.cba_id');

yii miss create the sql sentence resulting in a error near:

isnull(cba.HSLET, [0)]

ScaisEdge
  • 131,976
  • 10
  • 91
  • 107
Yordankis
  • 93
  • 7

1 Answers1

0

From Yii 2 Guide:

Besides column names, you can also select DB expressions. You must use the array format when selecting a DB expression that contains commas to avoid incorrect automatic name quoting.

So it should be:

$query->select(["ISNULL(cba.HSLET, 0)"]);
Bizley
  • 17,392
  • 5
  • 49
  • 59