本文整理汇总了PHP中Artists::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Artists::select方法的具体用法?PHP Artists::select怎么用?PHP Artists::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Artists
的用法示例。
在下文中一共展示了Artists::select方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBrowse
public function getBrowse($category)
{
//Get browse category
$category_filtered = strtoupper(trim($category));
//Page Title
$data['title'] = $category_filtered;
//Switch to get appropriate data, redirect to error if options aren't listed
switch ($category_filtered) {
case 'SERIES':
$data['comics'] = Comicbooks::orderBy('book_name', 'asc')->get();
break;
case 'AUTHORS':
$data['comics'] = Authors::select('author_name')->orderBy('author_name', 'asc')->distinct()->get();
break;
case 'ARTISTS':
$data['comics'] = Artists::select('artist_name')->orderBy('artist_name', 'asc')->distinct()->get();
break;
case 'CHARACTERS':
$data['comics'] = Characters::select('character_name')->orderBy('character_name', 'asc')->distinct()->get();
break;
case 'PUBLISHERS':
$data['comics'] = Publishers::select('publisher_name')->orderBy('publisher_name', 'asc')->distinct()->get();
break;
case 'GENRES':
$data['comics'] = Genres::orderBy('genre_name', 'asc')->get();
break;
case 'YEARS':
//This needed to be a raw query because of the date
$data['comics'] = Comicissues::select(DB::raw('year(published_date) as year'))->orderBy('published_date', 'asc')->distinct()->get();
break;
default:
return Redirect::to('error');
break;
}
$this->layout->content = View::make('browse', $data);
}