本文整理匯總了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);
}