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


PHP Tag::orderBy方法代码示例

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


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

示例1: getIndex

 public function getIndex()
 {
     // Get all the tags, in alphabetical order
     $tags = Tag::orderBy('name', 'asc')->get();
     // Return the view to the user with the tags
     return view('tags.list', ['tags' => $tags]);
 }
开发者ID:NiramCFPT,项目名称:imagtag,代码行数:7,代码来源:TagController.php

示例2: edit

 /**
  * Show the form for creating a user profile.
  *
  * @return $this
  */
 public function edit()
 {
     $describes = Skill::orderBy('name')->lists('name', 'id')->all();
     // We want other to be at the bottom
     $other = array_search('Other', $describes);
     unset($describes[$other]);
     $describes[$other] = 'Other';
     $skills = Tag::orderBy('name')->lists('name', 'id')->all();
     $professions = Profession::orderBy('name')->lists('name', 'id')->all();
     $professions[] = 'Other';
     return view('profile.edit')->with('user', Auth::user())->with('describes', $describes)->with('skills', $skills)->with('route', Route::currentRouteName())->with('professions', $professions);
 }
开发者ID:katzumi,项目名称:talent4startups,代码行数:17,代码来源:ProfileController.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $data['tags'] = Tag::orderBy('tag')->get();
     return view('tags.index', $data);
 }
开发者ID:bishopm,项目名称:ncc,代码行数:10,代码来源:TagsController.php

示例4: all

 /**
  * Get all tags
  *
  * @return mixed
  */
 public function all()
 {
     return $this->model->orderBy('hot', 'desc')->get();
 }
开发者ID:forehalo,项目名称:materialize-blog,代码行数:9,代码来源:TagRepository.php

示例5: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($yy, $qq, $aa)
 {
     $fin = array();
     $fm = Helpers::getSetting('first_month');
     $m1 = $qq * 3 - 3 + $fm;
     $y1 = $yy;
     $m2 = $qq * 3 - 2 + $fm;
     $y2 = $yy;
     $m3 = $qq * 3 - 1 + $fm;
     $y3 = $yy;
     if ($m2 > 12) {
         $m2 = $m2 - 12;
         $y2 = $y2 + 1;
     }
     if ($m3 > 12) {
         $m3 = $m3 - 12;
         $y3 = $y3 + 1;
     }
     if ($aa == "edit") {
         $perms = Permission::where('user_id', '=', Auth::user()->id)->get();
         foreach ($perms as $perm) {
             if ($perm->preaching or $perm->admin) {
                 $data['authsoc'][] = $perm['society_id'];
             }
         }
         if (!isset($data['authsoc'])) {
             $aa = "view";
         }
     }
     $firstDateTime = mktime(0, 0, 0, $m1, 1, $y1);
     $firstDay = date("N", $firstDateTime);
     $firstSunday = date("d M Y", mktime(0, 0, 0, $m1, 8 - $firstDay, $y1));
     $lastSunday = strtotime($firstSunday);
     $lastDay = mktime(23, 59, 59, $m3, cal_days_in_month(CAL_GREGORIAN, $m3, $y3), $y3);
     $extras = Weekday::where('servicedate', '>=', $firstDateTime)->where('servicedate', '<=', $lastDay)->orderBy('servicedate')->get()->toArray();
     $data['meetings'] = Meeting::where('meetingdatetime', '<', $lastDay)->where('meetingdatetime', '>', $firstDateTime)->orderBy('meetingdatetime')->get();
     $dum['dt'] = $lastSunday;
     $dum['yy'] = intval(date("Y", $lastSunday));
     $dum['mm'] = intval(date("n", $lastSunday));
     $dum['dd'] = intval(date("j", $lastSunday));
     $sundays[] = $dum;
     $data['societies'] = Society::orderBy('society')->with('service')->get();
     $data['ministers'] = Minister::has('individual')->get();
     $data['preachers'] = Preacher::has('individual')->get();
     $data['guests'] = Guest::where('active', '=', 1)->get();
     while (date($lastSunday + 604800 <= $lastDay)) {
         $lastSunday = $lastSunday + 604800;
         $dum['dt'] = $lastSunday;
         $dum['yy'] = intval(date("Y", $lastSunday));
         $dum['mm'] = intval(date("n", $lastSunday));
         $dum['dd'] = intval(date("j", $lastSunday));
         $sundays[] = $dum;
     }
     if (count($extras)) {
         $xco = 0;
         for ($q = 0; $q < count($sundays); $q++) {
             if ($xco < count($extras) and $extras[$xco]['servicedate'] < $sundays[$q]['dt']) {
                 $dum['dt'] = $extras[$xco]['servicedate'];
                 $dum['yy'] = intval(date("Y", $extras[$xco]['servicedate']));
                 $dum['mm'] = intval(date("n", $extras[$xco]['servicedate']));
                 $dum['dd'] = intval(date("j", $extras[$xco]['servicedate']));
                 $data['sundays'][] = $dum;
                 $xco++;
                 $q = $q - 1;
             } else {
                 $data['sundays'][] = $sundays[$q];
             }
         }
     } else {
         $data['sundays'] = $sundays;
     }
     $pm1 = Plan::where('planyear', '=', $y1)->where('planmonth', '=', $m1)->get();
     foreach ($pm1 as $p1) {
         $soc = Society::find($p1->society_id)->society;
         $ser = Service::find($p1->service_id)->servicetime;
         if ($p1->preachable) {
             @($data['fin'][$soc][$p1->planyear][$p1->planmonth][$p1->planday][$ser]['preacher'] = substr($p1->preachable_type, 11, 1) . "_" . $p1->preachable->id);
             if ($p1->preachable_type == "App\\Models\\Guest") {
                 @($data['fin'][$soc][$p1->planyear][$p1->planmonth][$p1->planday][$ser]['pname'] = substr($p1->preachable->firstname, 0, 1) . " " . $p1->preachable->surname);
             } else {
                 @($data['fin'][$soc][$p1->planyear][$p1->planmonth][$p1->planday][$ser]['pname'] = substr($p1->preachable->individual->firstname, 0, 1) . " " . $p1->preachable->individual->surname);
             }
         } else {
             @($data['fin'][$soc][$p1->planyear][$p1->planmonth][$p1->planday][$ser]['preacher'] = "");
         }
         if ($p1->tag_id) {
             @($data['fin'][$soc][$p1->planyear][$p1->planmonth][$p1->planday][$ser]['tag'] = $p1->tag_id);
             @($data['fin'][$soc][$p1->planyear][$p1->planmonth][$p1->planday][$ser]['tname'] = Tag::find($p1->tag_id)->abbr);
         } else {
             @($data['fin'][$soc][$p1->planyear][$p1->planmonth][$p1->planday][$ser]['tag'] = "");
         }
     }
     $pm2 = Plan::where('planyear', '=', $y2)->where('planmonth', '=', $m2)->get();
     foreach ($pm2 as $p2) {
//.........这里部分代码省略.........
开发者ID:bishopm,项目名称:circuit,代码行数:101,代码来源:PlansController.php

示例6: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $tags = Tag::orderBy('id', 'desc')->paginate(15);
     return view('admin.tag.index', compact('tags'));
 }
开发者ID:mattvb91,项目名称:website-laravel,代码行数:10,代码来源:TagController.php

示例7: getAllOrderedBy

 public function getAllOrderedBy($column = 'id', $order = 'asc')
 {
     $tags = Tag::orderBy($column, $order)->get();
     return $tags;
 }
开发者ID:jaumesala,项目名称:opendata-maps,代码行数:5,代码来源:TagRepository.php

示例8: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $data['alltags'] = Tag::orderBy('tag')->get();
     $data['organisations'] = Organisation::orderBy('organisation')->get();
     $data['project'] = Project::find($id);
     $data['ptags'] = explode(',', $data['project']->tags);
     $data['latitude'] = $data['project']->latitude;
     $data['longitude'] = $data['project']->longitude;
     return view('projects.edit', $data);
 }
开发者ID:bishopm,项目名称:ncc,代码行数:16,代码来源:ProjectsController.php


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