当前位置: 首页>>代码示例>>PHP>>正文


PHP Topic::orderBy方法代码示例

本文整理汇总了PHP中app\Topic::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Topic::orderBy方法的具体用法?PHP Topic::orderBy怎么用?PHP Topic::orderBy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Topic的用法示例。


在下文中一共展示了Topic::orderBy方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     $topics = Topic::orderBy('status', 'asc')->orderBy('sorter', 'desc')->get();
     if ($request->format() != 'html') {
         return $topics;
     } else {
         return view('topic.index', ['topics' => $topics]);
     }
 }
开发者ID:kikyous,项目名称:laravel,代码行数:14,代码来源:TopicController.php

示例2: menuList

 public function menuList(Request $request)
 {
     // $classes = Video::distinct()->groupBy('class')->get();
     // //$topicsList = Video::distinct()->groupBy('topic')->get();
     // //$topicsList = Topic::distinct()->groupBy('course')->orderBy('priority','ASC')->get();
     // $topicsList = Video::join('topics',function($join){
     // 	$join->on('videos.topic','=','topics.topic')->On('videos.class','=','topics.course');
     // })->groupBy('topics.topic')->orderBy('priority', 'ASC')->get();
     // $menuList = Video::get();
     // $videos = Video::where('instructor','like', $squery)->orWhere('title', 'like', $squery)->orWhere('class', 'like', $squery)->orderBy('id', 'DESC')->paginate(15);
     // $data = Video::join('topics',function($join){
     // 	$join->on('videos.class','=','topics.course') ->on('videos.unit','=','topics.unit');
     // })->groupBy('topics.course')->orderBy('priority', 'ASC')->get();
     $data = Video::orderBy('order', 'ASC')->get();
     $classes = Video::distinct()->groupBy('class')->get();
     $menuList = Topic::orderBy('priority', 'ASC')->get();
     return view('videos.menu', compact('menuList', 'classes', 'data'));
     //return view('videos.menu', compact('videos'))->with('search', $search);
     //return view('videos.menu');
 }
开发者ID:ravikanth720,项目名称:vidman-laravel,代码行数:20,代码来源:MenuController.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $topics = Topic::orderBy('updated_at', 'desc')->paginate(24);
     return view('topics.index', compact('topics'));
 }
开发者ID:gentcys,项目名称:fzzt,代码行数:10,代码来源:TopicsController.php

示例4: allChannel

 public function allChannel()
 {
     return view('webboard', ['latestTopic' => 'latest topic', 'topics' => Topic::orderBy('created_at')->paginate(config('app.frontEnd.topic.per_page')), 'channels' => Channel::all(), 'user' => Auth::user()]);
 }
开发者ID:JesadaMTK,项目名称:issara,代码行数:4,代码来源:WebBoardController.php

示例5: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($video)
 {
     $units = Topic::orderBy('priority', 'ASC')->get();
     $topics = Video::distinct()->select(['class', 'topic'])->orderBy('class', 'ASC')->get();
     return view('videos.edit', compact('video', 'units', 'topics'));
 }
开发者ID:ravikanth720,项目名称:vidman-laravel,代码行数:12,代码来源:VideosController.php

示例6: index

 /**
  * Display all topics
  * @return \Illuminate\View\View
  */
 public function index()
 {
     $topics = Topic::orderBy('title', 'asc')->get();
     return view('topics.index', compact('topics'));
 }
开发者ID:enhive,项目名称:vev,代码行数:9,代码来源:TopicController.php


注:本文中的app\Topic::orderBy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。