Output the SQL from a query builder
 $x=\common\models\Partner::find()->innerJoin('invoice', 'invoice.companyId=companyId')->where(['invoice.companyId'=>'7']);
    $x->all();
    U::debug($x->createCommand()->getRawSql());
    die;
$x=\common\models\Partner::find()->joinWith(['invoices'])->where(['invoice.companyId'=>'7']);
    $x->all();
    U::debug($x->createCommand()->getRawSql());
    die;

About

Das Yii Man

Categories: HINTS (tehnice) |

Leave a Reply

Your email address will not be published. Required fields are marked *

[TOP]