本文整理汇总了PHP中Banner::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Banner::orderBy方法的具体用法?PHP Banner::orderBy怎么用?PHP Banner::orderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Banner
的用法示例。
在下文中一共展示了Banner::orderBy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$authuser = Auth::user();
//$listaDePost = Proveedor::paginate(15);
$Banners = Banner::orderBy('seccion', 'asc')->paginate(10);
return View::make('administracion.pages.banners.index')->with(array('Banners' => $Banners, 'usuarioimg' => $authuser->imagen, 'usuarionombre' => $authuser->nombre, 'usuarioid' => $authuser->id));
}
示例2: index
public function index()
{
// latest / fresh
$data['page'] = '';
$data['video'] = Featuredvideo::find(1);
$data['banners'] = Banner::orderBy('id')->get();
$data['freshpost'] = Post::orderBy('created_at', 'desc')->take(5)->get();
$data['featuredpost'] = FeaturedPost::orderBy('id', 'desc')->take(10)->with('post')->get();
$data['trendingpost'] = Post::select('posts.*', DB::raw('count(votes.id) as total'))->leftJoin('votes', 'posts.id', '=', 'votes.post_id')->groupBy('posts.id')->orderBy('total', 'desc')->take(6)->get();
return View::make('main2')->with($data);
}
示例3:
<?php
/**
* Created by qlm label makers Developer ndmson.
* User: ndmson
* Date: 14/10/2015
* Time: 12:21 PM
*/
$_banners = Banner::orderBy('banner_order', 'asc')->get();
$_i = 0;
$_y = 0;
?>
<header>
<!-- ******************************************************************** -->
<!-- img carousel -->
<div class="carousel slide carousel-fade" data-ride="carousel" id="qlm-img-carousel">
<div class="carousel-inner">
@foreach($_banners as $_banner)
<div class="item @if($_i==0) {{'active'}} @endif">
<img data-original="asserts/images/Banner/{{$_banner->banner_images}}" class="img-responsive lazy">
</div>
<?php
$_i++;
?>
@endforeach
<!-- ******************************************************************** -->
</div>
</div>
<!-- Box Overlay -->
<div class="carousel-caption-modified">
<!-- text carousel -->
<div class="carousel slide" data-ride="carousel" id="text-img-carousel">
示例4: index
public function index()
{
$data['page'] = 'me';
$data['banners'] = Banner::orderBy('id')->get();
return View::make('admin.banners')->with($data);
}