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


PHP City::orderby方法代碼示例

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


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

示例1: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     // itemList
     view()->composer(array('product.bomitems.createitem', 'product.bomitems.edit', 'sales.soitems.create', 'sales.soitems.edit'), function ($view) {
         $view->with('itemList', \App\models\Product\Item::orderby('id', 'asc')->lists('item_number', 'id'));
     });
     // itemclassList
     view()->composer(array('items.create', 'items.edit', 'product.items.create', 'product.items.edit'), function ($view) {
         $view->with('itemclassList', \App\models\Product\Itemclass::orderby('id', 'asc')->lists('name', 'id'));
     });
     // itemtypeList
     view()->composer(array('items.create', 'items.edit', 'product.items.create', 'product.items.edit'), function ($view) {
         $view->with('itemtypeList', \App\Itemtype::orderby('id', 'asc')->lists('name', 'id'));
     });
     // provinceList
     view()->composer(array('addr.citys.create', 'addr.citys.edit', 'addr.addrs.create', 'addr.addrs.edit'), function ($view) {
         $view->with('provinceList', \App\Province::orderby('id', 'asc')->lists('name', 'id'));
     });
     // cityList
     view()->composer(array('addr.addrs.create', 'addr.addrs.edit'), function ($view) {
         $view->with('cityList', \App\City::orderby('id', 'asc')->lists('name', 'id'));
     });
     // addrList
     view()->composer(array('contacts.create', 'contacts.edit', 'inventory.warehouses.create', 'inventory.warehouses.edit', 'purchase.vendinfos.create', 'purchase.vendinfos.edit'), function ($view) {
         $view->with('addrList', \App\Addr::orderby('id', 'asc')->lists('line1', 'id'));
     });
     // contactList
     view()->composer(array('custinfos.create', 'custinfos.edit', 'inventory.warehouses.create', 'inventory.warehouses.edit', 'purchase.vendinfos.create', 'purchase.vendinfos.edit', 'purchase.purchaseorders.create', 'purchase.purchaseorders.edit'), function ($view) {
         $view->with('contactList', \App\Contact::orderby('id', 'asc')->lists('name', 'id'));
     });
     // deptList
     view()->composer(array('system.employees.create', 'system.employees.edit'), function ($view) {
         $view->with('deptList', \App\System\Dept::orderby('id', 'asc')->lists('name', 'id'));
     });
     // imageList
     view()->composer(array('system.employees.create', 'system.employees.edit'), function ($view) {
         $view->with('imageList', \App\System\Image::orderby('id', 'asc')->lists('name', 'id'));
     });
     // custinfoList
     view()->composer(array('sales.salesorders.create', 'sales.salesorders.edit'), function ($view) {
         $view->with('custinfoList', \App\Custinfo::orderby('id', 'asc')->lists('name', 'id'));
     });
     // salesrepList
     view()->composer(array('sales.salesorders.create', 'sales.salesorders.edit'), function ($view) {
         $view->with('salesrepList', \App\Sales\Salesrep::orderby('id', 'asc')->lists('name', 'id'));
     });
     // termList
     view()->composer(array('purchase.vendinfos.create', 'purchase.vendinfos.edit', 'purchase.purchaseorders.create', 'purchase.purchaseorders.edit'), function ($view) {
         $view->with('termList', \App\Sales\Term::orderby('id', 'asc')->lists('code', 'id'));
     });
     // vendtypeList
     view()->composer(array('purchase.vendinfos.create', 'purchase.vendinfos.edit'), function ($view) {
         $view->with('vendtypeList', \App\Purchase\Vendtype::orderby('id', 'asc')->lists('code', 'id'));
     });
     // vendinfoList
     view()->composer(array('purchase.purchaseorders.create', 'purchase.purchaseorders.edit'), function ($view) {
         $view->with('vendinfoList', \App\Purchase\Vendinfo::orderby('id', 'asc')->lists('number', 'id'));
     });
     // soheadList
     view()->composer(array('purchase.purchaseorders.create', 'purchase.purchaseorders.edit'), function ($view) {
         $view->with('soheadList', \App\Sales\Salesorder::orderby('id', 'asc')->lists('number', 'id'));
     });
     // itemsiteList
     view()->composer(array('purchase.poitems.create', 'purchase.poitems.edit'), function ($view) {
         //             $items = \App\Inventory\Itemsite::orderby('itemsites.id', 'asc')->leftJoin('items', 'itemsites.item_id', '=', 'items.id')->select('item_number', 'itemsites.id')->get();
         $view->with('itemsiteList', \App\Inventory\Itemsite::orderby('itemsites.id', 'asc')->leftJoin('items', 'itemsites.item_id', '=', 'items.id')->select('item_number', 'itemsites.id')->lists('item_number', 'id'));
         //             $view->with('itemsiteList', DB::table('itemsites')->leftJoin('items', 'itemsites.item_id', '=', 'items.id')->select('item_number', 'itemsites.id')->lists('item_number', 'itemsites.id'));
         //             $view->with('itemsiteList', \App\Inventory\Itemsite::orderby('itemsites.id', 'asc')->lists('item_id', 'id'));
     });
     // roleList
     view()->composer(array('system.users.editrole'), function ($view) {
         $view->with('roleList', \App\Role::orderby('id', 'asc')->lists('name', 'id'));
     });
     // charIList: item char list
     view()->composer(array('items.create', 'items.edit', 'product.items.create', 'product.items.edit'), function ($view) {
         $view->with('charIList', \App\Product\Characteristic::orderby('id', 'asc')->where('bitems', true)->lists('name', 'id'));
     });
 }
開發者ID:seahouse,項目名稱:hxerp,代碼行數:83,代碼來源:ViewComposerServiceProvider.php


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