Exemple #1
0
 /**
  * 音乐页面
  *
  * @param int $id
  * @return Response
  */
 public function titlePage($id)
 {
     // fetch music
     $music = Music::find($id);
     // collect the total counts
     $total = [];
     foreach ($music->programs as $pm) {
         empty($total[$pm->dates->year]) and $total[$pm->dates->year] = 0;
         $total[$pm->dates->year]++;
     }
     $total = self::fillChartData($total);
     // TDK
     $title = implode(' - ', [$music->title, $music->artists->pluck('name')->implode(', ')]);
     $description = '飞鱼秀歌单, 飞鱼秀音乐列表';
     // render
     return View::make('music.song')->with('music', $music)->with('total', $total)->with('title', $title)->with('description', $description);
 }