本文整理汇总了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']);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}