public function getLastAudio() { return Music::getMusic(['userId' => $this->id]); }
public function actionSearchmusicfromself() { $thisUser = User::thisUser(); $value = Yii::$app->request->post('value'); $data = ['userId' => $thisUser->id, 'artistOrTitle' => $value]; $musicModels = Music::getMusic($data); $results = []; foreach ($musicModels as $music) { $results[] = ['musicHtml' => SoundWidget::widget(['music' => $music]), 'musicId' => $music->id, 'musicUrl' => Url::to(['music/sound', 'id' => $music->id])]; } return json_encode($results); }