本文整理汇总了PHP中Attachment::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Attachment::orderBy方法的具体用法?PHP Attachment::orderBy怎么用?PHP Attachment::orderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attachment
的用法示例。
在下文中一共展示了Attachment::orderBy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$items = Attachment::orderBy('name', 'ASC')->paginate(50);
// $items = Attachment::where('mime', '!=', 'text/plain')->orderBy('name', 'ASC')->paginate(50);
$search = '';
// $lectures = Attachment::orderBy('name', 'ASC')->paginate(50);
return View::make('attachment.view_attachment', compact('items', 'search'));
}
示例2: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$attachments = Attachment::orderBy('id', 'desc')->paginate(25);
$uploads = DB::table('uploads')->select('name', 'owner', 'md5', 'sha1')->where('owner', Auth::user()->username)->orderBy('updated_at', 'desc')->paginate(25);
$alluploads = DB::table('uploads')->select('name', 'owner', 'md5', 'sha1')->orderBy('updated_at', 'desc')->paginate(25);
$attachmentsCount = count($attachments);
$uploadsCount = count($uploads);
$alluploadsCount = count($alluploads);
return View::make('attachments.index', ['attachments' => $attachments, 'uploads' => $uploads, 'alluploads' => $alluploads, 'attachmentsCount' => $attachmentsCount, 'uploadsCount' => $uploadsCount, 'alluploadsCount' => $alluploadsCount]);
}
示例3: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
return View::make('attachments.index', ['attachments' => Attachment::orderBy('id', 'desc')->paginate(25)]);
}
示例4: getAttachments
protected static function getAttachments($range)
{
return [];
$id = intval($range);
if ($id != 0) {
return Logbook::find($id)->user->attachments;
}
return Attachment::orderBy('id', 'asc')->get();
}