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


PHP Project::orderBy方法代码示例

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


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

示例1: moduleAndPageCreate

 public function moduleAndPageCreate($request)
 {
     $projectID = Project::orderBy('id', 'desc')->first();
     $modules = $request->projected_total_modules;
     $m = 1;
     $pages = $request->projected_total_pages / $request->projected_total_modules;
     $p = 1;
     $pageNumber = 1;
     while ($m <= $modules) {
         $newModule = new Module();
         $newModule->project_id = $projectID->id;
         $newModule->name = 'Modulo' . $m;
         $newModule->projected_total_pages = $pages;
         $newModule->save();
         $p = 1;
         while ($p <= $pages) {
             $moduleID = Module::orderBy('id', 'desc')->first();
             $newPage = new Page();
             $newPage->module_id = $moduleID->id;
             $newPage->name = $pageNumber;
             $newPage->save();
             $p++;
             $pageNumber++;
         }
         $m++;
     }
 }
开发者ID:AmilcarCondino,项目名称:Circulo_v2,代码行数:27,代码来源:Project.php

示例2: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     $projects = Project::orderBy('priority')->get();
     if ($request->ajax()) {
         return $projects->toArray();
     }
     return view('admin.projects.index', ['projects' => $projects]);
 }
开发者ID:vankhoektcn,项目名称:Qqsipe2UY67gLO7BWrou,代码行数:13,代码来源:ProjectsController.php

示例3: pdf

 public function pdf()
 {
     /// listado en pdf, de los projectos mas recientes con los datos mas importantes.
     $projects = Project::orderBy('name', 'desc')->get();
     $pdf = PDF::loadView('projects/pdf', compact('projects'));
     //ciclo para recorrer el array
     return $pdf->stream();
 }
开发者ID:luiscarlosmarca,项目名称:matixmedia,代码行数:8,代码来源:ProjectController.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     $type = $request->type;
     $items = Project::orderBy('updated_at', 'created_at');
     if (empty($type) || $type == 'invalid') {
         return view('showroom', ['items' => $items->paginate(4), 'profiles' => User::all()]);
     } else {
         return view('showroom', ['items' => $items->where('type', $request->type)->paginate(4), 'profiles' => User::all()]);
     }
 }
开发者ID:bambangsusanto,项目名称:planatrium,代码行数:15,代码来源:ShowroomController.php

示例5: adminProjects

 public function adminProjects(Request $request, $category = null)
 {
     $this->layout = 'project.table';
     $this->metas['title'] = "Бүх Төслүүд";
     // General list
     $projects = Project::orderBy('id', 'DESC')->paginate(10);
     $this->view = $this->BuildLayout();
     $this->view->withUser($this->user)->withProjects($projects);
     return $this->view;
 }
开发者ID:sordev,项目名称:bootup,代码行数:10,代码来源:ProjectController.php

示例6: index

 /**
  * Display a listing of the resource.
  *
  * @param Request $request
  * @return Response
  */
 public function index(Request $request)
 {
     $orderBy = $request->has('orderBy') ? $request->input('orderBy') : 'nama_project';
     $order = $request->has('order') ? $request->input('order') : 'asc';
     if ($request->has('query')) {
         $data_project = Project::orderBy($orderBy, $order)->where($request->input('searchBy'), 'like', '%' . $request->input('query') . '%')->paginate(15);
     } else {
         $data_project = Project::orderBy($orderBy, $order)->paginate(15);
     }
     return view('project.index', compact('data_project', 'request'));
 }
开发者ID:nugi,项目名称:SI_Dinas,代码行数:17,代码来源:ProjectController.php

示例7: index

 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function index()
 {
     $expensesss = Expense::where('project_id', '=', 0)->first();
     $expensess = Expense::where('project_id', '=', 0)->orderBy('paid_on', 'desc')->get();
     $clients = Client::orderBy('created_at', 'desc')->get();
     $projects = Project::orderBy('created_at', 'desc')->get();
     $expenses = Expense::where('project_id', '>', 0)->orderBy('paid_on', 'desc')->get();
     $payments = Payment::orderBy('created_at', 'desc')->get();
     $hours = Hour::where('amount_paid', '<', 0)->orderBy('day_worked', 'desc')->get();
     return view('home', compact('projects', 'expenses', 'payments', 'hours', 'clients', 'expensess', 'expensesss'));
 }
开发者ID:patrykszady,项目名称:gstest,代码行数:16,代码来源:HomeController.php

示例8: index

 public function index()
 {
     $data['projects'] = Project::orderBy('created_at', 'desc')->get();
     $data['kdenlive_profiles'] = Conf::getKdenliveProfiles();
     $confs = array();
     $dbconfs = Conf::get();
     foreach ($dbconfs as $c) {
         $confs[$c->name] = $c->value;
     }
     $data['confs'] = $confs;
     return view('homepage', $data);
 }
开发者ID:OfficineDigitali,项目名称:pasolino,代码行数:12,代码来源:MainController.php

示例9: boot

 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     view()->composer('master', function ($view) {
         $view->with('projects2', Project::orderBy('completion_date', 'DESC')->take(5)->get());
     });
     view()->composer('pages.frontpage', function ($view) {
         $view->with('projects2', Project::orderBy('completion_date', 'DESC')->take(5)->get());
     });
     view()->composer('errors.404', function ($view) {
         $view->with('projects2', Project::orderBy('completion_date', 'DESC')->take(5)->get());
     });
 }
开发者ID:botlax,项目名称:talalcontracting,代码行数:17,代码来源:AppServiceProvider.php

示例10: index

 /**
  * Display a listing of project
  *
  * @return Response
  */
 public function index()
 {
     if (\Request::ajax()) {
         $projectsnew = array();
         $projects = Project::orderBy('id', 'DESC')->get();
         foreach ($projects as &$value) {
             $value->users;
         }
         return json_encode($projects);
     }
     return view('projects.team');
 }
开发者ID:phanngoc,项目名称:internal-tool,代码行数:17,代码来源:ProjectController.php

示例11: index

 public function index()
 {
     //Slideshow
     $slideshow = [['title' => 'Туршилтын нээлт явагдаж байна', 'desc' => 'Төслийн туршилын хугацаа эхлэж байна.', 'slide' => asset('images/homeslides/staging.jpg'), 'cta' => 'Алдааны мэдээлэл илгээх', 'url' => 'https://docs.google.com/forms/d/e/1FAIpQLSd_DYqUn2EPkDblQpqr93mcJT5bvD40wgmaPKyHRXmvq1GrxQ/viewform?c=0&w=1'], ['title' => 'BOOTUP.mn гэж юу вэ?', 'desc' => 'BootUP.mn бол мэдээллийн технологийн шинэлэг санаатай залууст эхний ээлжийн хөрөнгө оруулалтыг сайтаараа дамжуулан олон нийтээс босгох веб сайт юм. Бид зөвхөн эхний хөрөнгө оруулалт босгоод зогсохгүй зөвлөгөө өгч төслийг үр дүнтэй болгох талаас нь дэмжин ажиллах бөгөөд хөрөнгө оруулалтын хугацаа дуусмагц дараагийн хөрөнгө оруулагчтай холбох суваг нь болно. Танилцуулга материалыг <a href="https://dl.dropboxusercontent.com/u/46338286/bootup.pdf" target="_blank">эндээс татаарай</a>.', 'slide' => asset('images/homeslides/main.jpg'), 'cta' => 'Яг одоо өөрийнхөө төслийг оруулах', 'url' => url('project/add')]];
     // Set metas for SEO
     $this->metas = ['title' => 'Бүүтап төслүүд', 'keywords' => 'bootup', 'description' => 'Бүүтап төсөл, Хамтдаа хөгжицгөөе', 'author' => 'Бүүтап'];
     $projects = [];
     $projects['featured'] = Project::where('featured', '1')->orderBy('created_at')->get()->take(4);
     $projects['updated'] = Project::orderBy('updated_at')->get()->take(4);
     $projects['new'] = Project::orderBy('created_at')->get()->take(4);
     $this->layout = 'main.homepage';
     $this->view = $this->BuildLayout();
     $this->view->withProjects($projects)->withSlideshow($slideshow);
     return $this->view;
 }
开发者ID:sordev,项目名称:bootup,代码行数:15,代码来源:HomeController.php

示例12: listProjects

 /**
  * Index method that returns all projects in database
  *
  * This function has uses an Eloquent query to return a list of ID and name
  * for all projects stored in the database.
  *
  * @since 1.1.0
  *
  * @return Response A HTTP Response object formatted as JSON
  */
 public function listProjects()
 {
     try {
         $statusCode = 200;
         $projects = Project::orderBy('pname', 'asc')->get();
         $response = [];
         foreach ($projects as $project) {
             $this_row = array('id' => $project->id, 'name' => $project->pname);
             $response[] = $this_row;
         }
     } catch (Exception $e) {
         $statusCode = 400;
     } finally {
         return Response::json($response, $statusCode);
     }
 }
开发者ID:blueprint1985,项目名称:todolist,代码行数:26,代码来源:ProjectRepository.php

示例13: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $project = new Project();
     if (Project::first()) {
         $project_id = Project::orderBy('id', 'desc')->first()->id;
         $project_id++;
     } else {
         $project_id = 1;
     }
     $project->project_name = $request->project_name;
     $project->project_desc = $request->project_desc;
     $project->project_catagory = $request->project_catagory;
     $project->project_info = $request->project_info;
     $project->project_slug = rtrim(preg_replace('/[^a-z0-9]+/i', '-', strtolower(strip_tags($request->project_name))), "-");
     if ($request->light_img == "on") {
         $project->is_light_img = true;
     }
     if ($request->hasFile('cover_img')) {
         $cover_img = $request->file('cover_img');
         $file_ext = $cover_img->guessExtension();
         $fileName = $project_id . "-cover." . $file_ext;
         $cover_img->move('upload', $fileName);
     }
     if ($request->hasFile('all_img')) {
         $files = $request->file('all_img');
         $file_count = 0;
         foreach ($files as $ind_file) {
             $file_count++;
             $file_ext = $ind_file->guessExtension();
             $fileName = $project_id . "-" . $file_count . "." . $file_ext;
             $ind_file->move('upload', $fileName);
         }
     }
     $project->photo_count = $file_count;
     $project->save();
     return redirect('/portfolio/' . $project->project_slug);
 }
开发者ID:naughton-and-ross,项目名称:nr2016,代码行数:43,代码来源:ProjectsController.php

示例14: getProjectList

 public function getProjectList()
 {
     $items = Project::orderBy('created_at', 'asc')->get();
     return view('projects.main', ['items' => $items]);
 }
开发者ID:metreniuk,项目名称:campsoup,代码行数:5,代码来源:ProjectMainController.php

示例15: actividadBeneficiario

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function actividadBeneficiario()
 {
     $proyectos = Project::orderBy('name', 'asc')->lists('name', 'id');
     return view("admin.informes.actividad", compact('proyectos'));
 }
开发者ID:JohanArmando,项目名称:ProyectoGrado,代码行数:10,代码来源:InformeController.php


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