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


PHP Supplier::orderBy方法代码示例

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


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

示例1: testUpdate

 /**
  * Tests the update function in the SupplierController
  * @depends testStore
  * @param void
  * @return void
  */
 public function testUpdate()
 {
     $this->be(User::first());
     $this->runStore($this->input);
     $supplierSaved = Supplier::orderBy('id', 'desc')->take(1)->get()->toArray();
     // Update the supplier
     $this->runUpdate($this->inputUpdate, $supplierSaved[0]['id']);
     $supplierUpdated = Supplier::orderBy('id', 'desc')->take(1)->get()->toArray();
     $this->assertEquals($supplierUpdated[0]['name'], $this->inputUpdate['name']);
     $this->assertEquals($supplierUpdated[0]['phone_no'], $this->inputUpdate['phone_no']);
     $this->assertEquals($supplierUpdated[0]['email'], $this->inputUpdate['email']);
     $this->assertEquals($supplierUpdated[0]['physical_address'], $this->inputUpdate['physical_address']);
 }
开发者ID:BaobabHealthTrust,项目名称:iBLIS,代码行数:19,代码来源:SupplierControllerTest.php

示例2: generateId

 public static function generateId()
 {
     $supplier = Supplier::orderBy('supplierID', 'DESC')->get()->first();
     $supplierId = $supplier->supplierID;
     $supplierId = substr($supplierId, 4);
     $newId = (int) $supplierId;
     $newId++;
     $newIdString = (string) $newId;
     $newIdString = "000000" . $newIdString;
     if (strlen($newIdString) > 3) {
         $newIdString = substr($newIdString, strlen($newIdString) - 3);
     }
     $newIdString = "SU" . $newIdString;
     return $newIdString;
 }
开发者ID:NathanaelFebrianto,项目名称:Citramas,代码行数:15,代码来源:Supplier.php

示例3: get

 public function get($id = null)
 {
     $search = Input::get('search');
     if (!is_null($search)) {
         $supplierOrders = SupplierOrder::select('supplier_orders.*')->join('suppliers', 'suppliers.id', '=', 'supplier_orders.suppliers_id')->where('suppliers.name', 'like', '%' . $search . '%')->orWhere('code', 'like', '%' . $search . '%')->orderBy('supplier_orders.created_at', 'DESC')->paginate(15);
     } else {
         $supplierOrders = SupplierOrder::where('status', 'generated')->orderBy('created_at', 'DESC')->paginate(15);
     }
     $selectedSupplierOrder = self::__checkExistence($id);
     if (!$selectedSupplierOrder) {
         $selectedSupplierOrder = new SupplierOrder();
     }
     $products = $selectedSupplierOrder->products->toArray();
     $suppliers = Supplier::orderBy('name')->get()->lists('name', 'id');
     return View::make('supplierOrders.main')->with('id', $id)->with('selectedSupplierOrder', $selectedSupplierOrder)->with('products', $products)->with('suppliers', $suppliers)->with('search', $search)->with('supplierOrders', $supplierOrders);
 }
开发者ID:frankpaul142,项目名称:cloudinventory,代码行数:16,代码来源:SupplierOrderController.php

示例4: suppliersList

function suppliersList()
{
    $supplier_list = array('' => Lang::get('general.select_supplier')) + Supplier::orderBy('name', 'asc')->orderBy('name', 'asc')->lists('name', 'id');
    return $supplier_list;
}
开发者ID:jotterbot,项目名称:snipe-it,代码行数:5,代码来源:helpers.php

示例5: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     $suppliers = Supplier::orderBy('name', 'ASC')->get();
     return View::make('inventory.supplier.index')->with('suppliers', $suppliers);
 }
开发者ID:echiteri,项目名称:iBLIS,代码行数:11,代码来源:SupplierController.php


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