yii2 leftjoin问题

$query = static::find()->select(['u.*','resume.*']);
$query->leftJoin('user u', 'u.id=resume.user_id');
 $data = $query->all();

 var_dump($data);die;

如果不加->asArray()获取不到联表数据,

须加上 $data = $query->asArray()->all();

转载自:https://blog.csdn.net/renamayu/article/details/79908763

你可能感兴趣的:(#,YII2)