本文整理匯總了PHP中Topic::select方法的典型用法代碼示例。如果您正苦於以下問題:PHP Topic::select方法的具體用法?PHP Topic::select怎麽用?PHP Topic::select使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Topic
的用法示例。
在下文中一共展示了Topic::select方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getForums
public function getForums()
{
$this->layout->title = "Forums";
$this->layout->description = "";
$this->layout->keywords = "";
$this->layout->top_active = 6;
$topics = DB::table('topics')->get();
$topics_count = count($topics);
$categories = DB::table('categories')->get();
$categories_count = count($categories);
$category_topics = Topic::select(DB::raw('count("*") as count, category_id, title,categories.category_name'))->groupBy("category_name")->groupBy("title")->join('categories', 'topics.category_id', '=', 'categories.id')->get();
$this->layout->main = View::make('admin.forums', ['cat_topic' => $category_topics, 'count_cat' => $categories_count, 'count' => $topics_count, "main_tab" => 2, "sub_tab" => 1, "cat" => "forum"]);
}
示例2: scopeExcellentEx
public static function scopeExcellentEx($limit)
{
return Topic::select('id', 'title', 'user_id', 'created_at')->where('is_excellent', '=', true)->take($limit)->remember(10)->get();
}