$topic_id = $model[0]->id;
$news_query = \app\models\front\News::find()->leftJoin('story_relation t', 't.news_id = id')->andWhere(['t.topic_id'=>$topic_id])->limit(30);
$newsDataProvider = new \yii\data\ActiveDataProvider(
[
"query"=>$news_query,
"pagination" => false
]
);
$story = $newsDataProvider->getModels();
$buf = '';
foreach( $story as $a ){
$buf .= "{ img: '/images/news/news/".$a['id']."_size2.jpg',";
$buf .= " html: '