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


PHP Zone::orderBy方法代码示例

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


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

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $zones = Zone::orderBy('id')->get();
     $status = array();
     foreach ($zones as $zone_count => $zone) {
         $count = $zone_count + 1;
         $switch_relays = $zone->Relays;
         if ($switch_relays->count()) {
             foreach ($switch_relays as $relay) {
                 $status['zone_' . $count . '_status_' . $relay->relay_id] = $relay->status;
             }
         } else {
             for ($i = 0; $i < 6; $i++) {
                 $status['zone_' . $count . '_status_' . $i] = 'False';
             }
         }
     }
     $data = array('page' => 'zones', 'zones' => $zones, 'status' => $status);
     return View::make('zones.index', $data);
 }
开发者ID:atefth,项目名称:remote_access_system,代码行数:25,代码来源:ZoneController.php

示例2: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $client = Client::where('id', $id)->withTrashed()->with('contacts')->first();
     $deptos = explode(',', DEPARTAMENTOS);
     $zones = Zone::orderBy('name', 'ASC')->get();
     $groups = Group::get();
     $businesses = BusinessType::get();
     $dias = array();
     $fec = str_split($client->frecuency);
     foreach ($fec as $d) {
         array_push($dias, $d == "1" ? true : false);
     }
     if ($client) {
         if ($client->deleted_at != null) {
             $client->restore();
         }
         $contacts = $client->contacts;
         $contactos = array();
         foreach ($contacts as $contact) {
             # code...
             $contactos[] = array('id' => $contact->id, 'nombres' => $contact->first_name, 'apellidos' => $contact->last_name, 'email' => $contact->email, 'phone' => $contact->phone);
             //
         }
         $data = ['client' => $client, 'contactos' => $contactos, 'url' => 'clientes/' . $id, 'title' => 'Editar Cliente', 'zonas' => $zones, 'deptos' => $deptos, 'grupos' => $groups, 'negocios' => $businesses, 'd' => $dias];
         $account = Account::find(Auth::user()->account_id);
         //data = array_merge($data, self::getViewModel());
         $data = array_merge($data, array('cuenta' => $account));
         // return Response::json($data);
         return View::make('clientes.edit', $data);
     }
     Session::flash('error', 'No existe el usuario');
     return Redirect::to('clientes');
 }
开发者ID:Vrian7ipx,项目名称:repocas,代码行数:39,代码来源:ClientController.php


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