本文整理汇总了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();
}