當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Client::orderBy方法代碼示例

本文整理匯總了PHP中app\Client::orderBy方法的典型用法代碼示例。如果您正苦於以下問題:PHP Client::orderBy方法的具體用法?PHP Client::orderBy怎麽用?PHP Client::orderBy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Client的用法示例。


在下文中一共展示了Client::orderBy方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: clientsByName

 static function clientsByName()
 {
     $clients = Client::orderBy('name')->get(['id', 'name'])->getDictionary();
     return array_map(function ($client) {
         return $client->name;
     }, $clients);
 }
開發者ID:sethphillips,項目名稱:event_mailer,代碼行數:7,代碼來源:User.php

示例2: index

 public function index()
 {
     $clients = Client::orderBy('name', 'ASC')->get();
     $debtors = Debtor::orderBy('name', 'ASC')->get();
     $relations = Relation::all();
     $tariffs = Tariff::all();
     return view('relations.index', ['relations' => $relations, 'clients' => $clients, 'tariffs' => $tariffs, 'debtors' => $debtors]);
 }
開發者ID:PixelPartyRu,項目名稱:erp,代碼行數:8,代碼來源:RelationController.php

示例3: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $service = Service::findOrFail($id);
     $currencies = ['hrk' => 'HRK', 'usd' => 'USD', 'eur' => 'EUR'];
     $clients = Client::orderBy('name')->pluck('name', 'id')->toArray();
     $categories = Category::orderBy('name')->pluck('name', 'id')->toArray();
     return view('services.edit')->with(compact('service', 'currencies', 'clients', 'categories'));
 }
開發者ID:laravelista,項目名稱:kyle,代碼行數:14,代碼來源:ServiceController.php

示例4: index

 public function index()
 {
     $deliveries = Delivery::all();
     $clients = Client::orderBy('name', 'ASC')->get();
     $debtors = Debtor::orderBy('name', 'ASC')->get();
     $dateToday = Carbon::now()->format('Y-m-d');
     $registries = Delivery::orderBy('registry')->lists('registry', 'registry')->toArray();
     return view('delivery.index', ['registries' => $registries, 'deliveries' => $deliveries, 'clients' => $clients, 'debtors' => $debtors, 'dateToday' => $dateToday]);
 }
開發者ID:PixelPartyRu,項目名稱:erp,代碼行數:9,代碼來源:DeliveryController.php

示例5: 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

示例6: getUpdate

 public function getUpdate($ticketId)
 {
     $ticket = \App\Ticket::find($ticketId);
     $formOptions = [];
     $clients = \App\Client::orderBy('name', 'ASC')->get();
     $formOptions['client'] = \App\Helpers\FormHelper::objectsToKeyValueArray($clients, 'id', 'name');
     $formOptions['client'] = ['' => '--Not Assigned To Client--'] + $formOptions['client'];
     $statuses = \App\Status::orderBy('weight', 'ASC')->get();
     $formOptions['statuses'] = \App\Helpers\FormHelper::objectsToKeyValueArray($statuses, 'id', 'name');
     $formOptions['priorities'] = array_combine(range(1, 10), range(1, 10));
     $users = \App\User::all();
     $formOptions['users'] = \App\Helpers\FormHelper::objectsToKeyValueArray($users, 'id', 'email');
     return view('ticket.edit', ['ticket' => $ticket, 'formOptions' => $formOptions]);
 }
開發者ID:kilrizzy,項目名稱:laraticket,代碼行數:14,代碼來源:TicketController.php

示例7: report

 /**
  * Show the report for all things.
  *
  * @return [type]
  */
 public function report()
 {
     $services = Service::orderBy('month')->orderBy('day')->where('active', 1)->with(['client', 'category'])->get();
     $clients = Client::orderBy('name')->whereHas('services', function ($query) {
         $query->where('active', 1);
     })->with(['services' => function ($query) {
         $query->where('active', 1);
     }])->get();
     $categories = Category::orderBy('name')->whereHas('services', function ($query) {
         $query->where('active', 1);
     })->with(['services' => function ($query) {
         $query->where('active', 1);
     }])->get();
     return view('report')->with(compact('services', 'clients', 'categories'));
 }
開發者ID:laravelista,項目名稱:kyle,代碼行數:20,代碼來源:HomeController.php

示例8: mealRosterDinner

 public function mealRosterDinner()
 {
     $meals = Meal::orderBy('date_fed', 'desc')->first();
     $clients = Client::orderBy('lname', 'asc')->get();
     if ($meals->date_fed != date('Y-m-d')) {
         foreach ($clients as $client) {
             $meals = new Meal();
             $meals->date_fed = date('Y-m-d');
             $meals->client()->associate($client);
             $meals->breakfast = 0;
             $meals->lunch = 0;
             $meals->dinner = 0;
             $meals->save();
         }
     }
     return view('meal.meal_roster_dinner', compact('clients'));
 }
開發者ID:ecortez3,項目名稱:CCO,代碼行數:17,代碼來源:MealController.php

示例9: store

 public function store()
 {
     $rules = array('name' => 'required', 'country' => 'required', 'state' => 'required', 'city' => 'required', 'zip' => 'required', 'address' => 'required', 'contact' => 'required', 'phone' => 'required', 'email' => 'required|email', 'website' => 'url');
     $validator = Validator::make(Request::all(), $rules);
     if ($validator->passes()) {
         $store = new Client();
         $store->fill(Request::all());
         $store->save();
         // Reload Table Data
         $data_client = array('client' => Client::orderBy('id', 'desc')->get(), 'refresh' => true);
         return view('clients.table')->with($data_client);
     } else {
         if (Request::ajax()) {
             return view('clients.create')->withErrors($validator)->withInput(Request::all());
         }
         return 0;
     }
 }
開發者ID:sharudee,項目名稱:cos-ajax,代碼行數:18,代碼來源:ClientController.php

示例10: allAppointment

 function allAppointment()
 {
     if (isset($_SESSION['authorization'])) {
         if ($_SESSION['authorization'] == 1) {
             $clients = Client::orderBy('id', 'DESC')->get();
         } else {
             $clients = Client::where('doctor_id', $_SESSION['user_id'])->orderBy('id', 'DESC')->get();
         }
         return view('clients.allAppointment', ['clients' => $clients]);
     } else {
         //$_SESSION['mesaj'] = '<div class="form-signin" style="background-color:pink;"><center><p style="color:red;">Bu Sayfaya Girme Yetkiniz Yok .</p></center></div>';
         return Redirect::to('./sayfa-bulunamadi');
     }
 }
開發者ID:ufukpalavar52,項目名稱:laravel-php-projelerim,代碼行數:14,代碼來源:ClientsController.php

示例11: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return view('client.index', ['clients' => Client::orderBy('name')->get()]);
 }
開發者ID:Rhenan,項目名稱:tasks,代碼行數:9,代碼來源:ClientController.php

示例12: mealsTotal

 /**
  * @param $stdate
  * @param $edate
  * @return array
  */
 public function mealsTotal($stdate, $edate)
 {
     $clients = Client::orderBy('lname', 'asc')->get();
     $mealTotal = array();
     for ($i = 1; $i <= 31; $i++) {
         $dayTotal[$i] = 0;
     }
     foreach ($clients as $client) {
         $id = $client->id;
         $mealTotal[$id] = 0;
         $rowMeals[$id] = $client->meal()->where('date_fed', '>=', $stdate)->where('date_fed', '<', $edate)->get()->toArray();
         foreach ($rowMeals[$id] as $row) {
             $b = $row['breakfast'];
             $l = $row['lunch'];
             $d = $row['dinner'];
             $mealTotal[$id] += $b + $l + $d;
         }
     }
     return $mealTotal;
 }
開發者ID:ecortez3,項目名稱:CCO,代碼行數:25,代碼來源:ReportController.php

示例13: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $client = Client::orderBy('updated_at', 'desc')->paginate(50);
     return view('admin.client.index', compact('client'));
 }
開發者ID:thibaultvanc,項目名稱:organit,代碼行數:10,代碼來源:ClientController.php

示例14: __construct

 public function __construct()
 {
     $clients = Client::orderBy('name')->lists('name', 'id');
     view()->share(['clients' => $clients]);
 }
開發者ID:sethphillips,項目名稱:event_mailer,代碼行數:5,代碼來源:CampaignController.php

示例15: getIndex

 public function getIndex()
 {
     $clients = \App\Client::orderBy('name', 'ASC')->get();
     return view('client.index', ['clients' => $clients]);
 }
開發者ID:kilrizzy,項目名稱:laraticket,代碼行數:5,代碼來源:ClientController.php


注:本文中的app\Client::orderBy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。