$res = News::findOne($new_id)->toArray();
yii框架的多表联查:
controller层:
//news 与 news_theme 是多对一的关系
$infomsg=News::find()->with('newstheme')->asArray()->all();
model层:News
//news 与 news_theme 进行两表联查 多对一
public function getNewstheme()
{
return $this->hasOne(NewsTheme::className(), ['id' => 'news_theme_id']);
}