Hi
I’m getting the above error when the I reach ->all()
on the query builder. I’m not entirely sure why. I got the raw sql that the query generates, ran it and it runs fine. I noticed that my innerJoinWith
is causing the problem although I’m not entirely sure why. File is: in
C:\xampp-7\htdocs\www\vendor\yiisoft\yii2\db\QueryBuilder.php:1546
VtCol::find()
->alias('V')
->innerJoinWith('site')
//->innerJoinWith('cardNumber') -> Causes Error
//->joinWith('pat') -> Causes Error
->where(['V.DEL_DT' => null])
->andWhere(['<=', new Expression("TRUNC(TO_DATE(V.PRO_DATE, 'YYYYMMDD'))"), new Expression("TRUNC(TO_DATE('" . $quarterEndDate . "', 'YYYYMMDD'))")])
->andWhere(['V.FLWP_IND' => null])
->andWhere(['V.PASS_FOR_PAY' => null])
->andWhere(['V.SIGNED' => 'Y'])
->all();
I’ve shown one of the relations here:
public function getCardNumber()
{
return $this->hasOne(CardNumber::className(), ['P_ID' => 'P_ID'])
->andOnCondition(['CARD_NUMBER.CARD_TYPE_CD' => 35])
->andOnCondition(['CARD_NUMBER.DEL_DT' => null]);
}
But I’m still not entirely sure what the problem here is and wondered if anyone has any ideas?