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


PHP Product::orderBy方法代码示例

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


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

示例1: getIndex

 /**
  * All Products
  */
 public function getIndex()
 {
     // Page Title
     $this->_data['page_title'] = "Products";
     // Get All products
     $this->_data['products'] = Product::orderBy('name', 'ASC')->get();
     return View::make('admin.products.index', $this->_data)->nest('header', 'admin.common.header', $this->_data)->nest('footer', 'admin.common.footer', $this->_data);
 }
开发者ID:michaelotto126,项目名称:dksolution,代码行数:11,代码来源:ProductsController.php

示例2: display

 public function display()
 {
     $products = Product::all();
     $products = Product::orderBy('p_id', 'desc')->paginate(3);
     $users = User::all();
     $users = User::orderBy('id', 'desc')->paginate(3);
     $suppliers = Product::lists('supplier', 'supplier');
     $metals = Product::lists('metal', 'metal');
     return View::make('products.list')->with('products', $products)->with('suppliers', $suppliers)->with('metals', $metals)->with('users', $users);
 }
开发者ID:ArbindJain,项目名称:scrapkart,代码行数:10,代码来源:ProductsController.php

示例3: getIndex

 /**
  * Dashboard / All Transactions
  */
 public function getIndex()
 {
     // Page Title
     $this->_data['page_title'] = "Transactions";
     $this->_data['affiliates'] = Affiliate::orderBy('name', 'ASC')->get();
     $this->_data['products'] = Product::orderBy('name', 'ASC')->get();
     $transactions = new Transaction();
     $this->_data['transactions'] = $transactions->search();
     $this->_data['searchParams'] = $transactions->getSearchParams();
     $this->_data['revenue'] = $transactions->totalRevenue();
     $this->_data['paidAffliates'] = $transactions->paidToAffiliates();
     $this->_data['refundQueue'] = $transactions->refundQueueCount();
     return View::make('admin.transactions.index', $this->_data)->nest('header', 'admin.common.header', $this->_data)->nest('footer', 'admin.common.footer', $this->_data);
 }
开发者ID:michaelotto126,项目名称:dksolution,代码行数:17,代码来源:TransactionsController.php

示例4: getVideoIndex

 /**
  * View: Video Index
  * @return Respanse
  */
 public function getVideoIndex()
 {
     $articles = Article::orderBy('created_at', 'desc')->where('post_status', 'open')->paginate(6);
     $travel = Travel::orderBy('created_at', 'desc')->where('post_status', 'open')->paginate(4);
     $product = Product::orderBy('created_at', 'desc')->where('post_status', 'open')->where('quantity', '>', '0')->paginate(12);
     $productCategories = ProductCategories::orderBy('sort_order')->where('cat_status', 'open')->get();
     $job = Job::orderBy('created_at', 'desc')->where('post_status', 'open')->paginate(4);
     $categories = Category::orderBy('sort_order')->where('cat_status', 'open')->get();
     if (Auth::check()) {
         $timeline = Timeline::orderBy('created_at', 'desc')->where('user_id', Auth::user()->id)->paginate(6);
     } else {
         $timeline = Timeline::orderBy('created_at', 'desc');
     }
     return View::make('home.videoindex')->with(compact('articles', 'categories', 'travel', 'product', 'productCategories', 'job', 'timeline'));
 }
开发者ID:rimshavbase,项目名称:timefragment,代码行数:19,代码来源:HomeController.php

示例5: get

 public function get($id = null)
 {
     $search = Input::get('search');
     if (!is_null($search)) {
         $suppliers = Supplier::withTrashed()->where('name', 'like', '%' . $search . '%')->orWhere('ruc', 'like', '%' . $search . '%')->orderBy('name')->paginate(15);
     } else {
         $suppliers = Supplier::withTrashed()->orderBy('name')->paginate(15);
     }
     $selectedSupplier = self::__checkExistence($id);
     if (!$selectedSupplier) {
         $selectedSupplier = new Supplier();
     }
     $allProducts = Product::orderBy('name')->get()->lists('name', 'id');
     $selectedSupplierProducts = $selectedSupplier->products()->orderBy('name')->get()->toArray();
     return View::make('suppliers.main')->with('id', $id)->with('allProducts', $allProducts)->with('selectedSupplierProducts', array_fetch($selectedSupplierProducts, 'id'))->with('selectedSupplier', $selectedSupplier)->with('search', $search)->with('suppliers', $suppliers);
 }
开发者ID:frankpaul142,项目名称:cloudinventory,代码行数:16,代码来源:SupplierController.php

示例6: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     set_time_limit(0);
     if (is_null($obj)) {
         $product = new Product();
     } else {
         switch ($obj) {
             case 'product':
                 $product = new Product();
                 break;
             case 'page':
                 $product = new Page();
                 break;
             case 'post':
                 $product = new Posts();
                 break;
             default:
                 $product = new Product();
                 break;
         }
     }
     $props = $product->orderBy('_id', 'desc')->get();
 }
开发者ID:awidarto,项目名称:bilnatracker,代码行数:28,代码来源:StatCollector.php

示例7: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $items = Product::orderBy('name', 'ASC')->paginate(10);
     return View::make('product.view_product', compact('items'));
 }
开发者ID:alexlondon07,项目名称:accounting,代码行数:10,代码来源:ProductController.php

示例8: getCardUpdateUrl

 /**
  * Card Update URL
  */
 public function getCardUpdateUrl()
 {
     $this->_data['page_title'] = "Generate Card Update URL";
     $this->_data['products'] = Product::orderBy('name', 'ASC')->get();
     return View::make('admin.utilities.card-update-url', $this->_data)->nest('header', 'admin.common.header', $this->_data)->nest('footer', 'admin.common.footer', $this->_data);
 }
开发者ID:michaelotto126,项目名称:dksolution,代码行数:9,代码来源:UtilitiesController.php

示例9: products

 public function products()
 {
     $catagory = Catagory::all();
     $product = Product::orderBy('created_at', 'desc')->paginate(12);
     return View::make('Products.Shop', array('catagories' => $catagory, 'products' => $product));
 }
开发者ID:jorzhikgit,项目名称:MLM-Nexus,代码行数:6,代码来源:HomeController.php

示例10: shop

 public function shop()
 {
     $catagory = Catagory::all();
     $product = Product::orderBy('created_at', 'desc')->get();
     return View::make('users.shop', array('query' => $catagory, 'products' => $product));
 }
开发者ID:jorzhikgit,项目名称:MLM-Nexus,代码行数:6,代码来源:UserController.php

示例11: search

 public function search()
 {
     $search_year_ind = Utility::nvl(Input::get('search_year_ind'), 'All');
     $input = urldecode(Input::get('search'));
     if (!empty($input)) {
         $searchTerms = explode(',', $input);
         $query = Product::orderBy('workshop_year', 'desc')->orderBy('id', 'asc');
         // Assign index 0 search terms directly...
         $query->where('speaker_last_name', 'LIKE', '%' . $searchTerms[0] . '%')->orWhere('speaker_first_name', 'LIKE', '%' . $searchTerms[0] . '%')->orWhere('session_title', 'LIKE', '%' . $searchTerms[0] . '%');
         foreach ($searchTerms as $key => $value) {
             if ($key > 0) {
                 $query->orWhere('speaker_last_name', 'LIKE', '%' . $searchTerms[$key] . '%')->orWhere('speaker_first_name', 'LIKE', '%' . $searchTerms[$key] . '%')->orWhere('session_title', 'LIKE', '%' . $searchTerms[$key] . '%');
             }
         }
         $current_workshop_year = Config::get('workshop.current_workshop_year');
         if ($search_year_ind == 'Current') {
             $query->where('workshop_year', '=', $current_workshop_year);
         }
         $results = $query->remember(5)->get();
         //->paginate(20);
         $message = "Search results for search criteria '" . $input . "'.";
         ProductsController::makeIndexView($results, array('search_criteria' => $input, 'search_year_ind' => $search_year_ind, 'message' => $message));
     }
 }
开发者ID:marciocamello,项目名称:laravel-ecommerce,代码行数:24,代码来源:ProductsController.php

示例12: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     set_time_limit(0);
     $obj = $this->argument('object');
     if (is_null($obj)) {
         $product = new Product();
     } else {
         switch ($obj) {
             case 'product':
                 $product = new Product();
                 break;
             case 'page':
                 $product = new Page();
                 break;
             case 'post':
                 $product = new Posts();
                 break;
             default:
                 $product = new Product();
                 break;
         }
     }
     $props = $product->orderBy('_id', 'desc')->get();
     //$seq = new Sequence();
     $sizes = Config::get('picture.sizes');
     $cnt = 1;
     foreach ($props as $p) {
         echo $cnt . "\n";
         $cnt++;
         echo $p->_id . "\n";
         if (isset($p->files)) {
             $files = $p->files;
             foreach ($files as $folder => $files) {
                 $dir = public_path() . '/storage/media/' . $folder;
                 if (is_dir($dir) && file_exists($dir)) {
                     if ($dh = opendir($dir)) {
                         while (($file = readdir($dh)) !== false) {
                             if ($file != '.' && $file != '..') {
                                 if (!preg_match('/^lrg_|med_|th_|full_|blob/', $file)) {
                                     echo $dir . '/' . $file . "\n";
                                     $destinationPath = $dir;
                                     $filename = $file;
                                     $urls = array();
                                     foreach ($sizes as $k => $v) {
                                         echo $destinationPath . '/' . $v['prefix'] . $filename . "\n";
                                         if (file_exists($destinationPath . '/' . $v['prefix'] . $filename)) {
                                             unlink($destinationPath . '/' . $v['prefix'] . $filename);
                                         } else {
                                             echo "file does not exist\n";
                                         }
                                         $thumbnail = Image::make($destinationPath . '/' . $filename)->fit($v['width'], $v['height'])->save($destinationPath . '/' . $v['prefix'] . $filename);
                                         //print_r($thumbnail);
                                     }
                                     /*
                                     $thumbnail = Image::make($destinationPath.'/'.$filename)
                                         ->fit( $sizes['thumbnail']['width'] ,$sizes['thumbnail']['height'])
                                         ->save($destinationPath.'/th_'.$filename);
                                     
                                     $medium = Image::make($destinationPath.'/'.$filename)
                                         ->fit( $sizes['medium']['width'] ,$sizes['medium']['height'])
                                         ->save($destinationPath.'/med_'.$filename);
                                     
                                     $large = Image::make($destinationPath.'/'.$filename)
                                         ->fit( $sizes['large']['width'] ,$sizes['large']['height'])
                                         ->save($destinationPath.'/lrg_'.$filename);
                                     
                                     $full = Image::make($destinationPath.'/'.$filename)
                                         ->fit( $sizes['full']['width'] ,$sizes['full']['height'])
                                         ->save($destinationPath.'/full_'.$filename);
                                     */
                                 }
                             }
                         }
                         closedir($dh);
                     }
                 }
             }
         }
     }
 }
开发者ID:awidarto,项目名称:tmadminflat,代码行数:85,代码来源:RegeneratePic.php

示例13: getIndex

 public function getIndex()
 {
     $products = Product::orderBy('created_at', 'DESC')->paginate(4);
     return View::make('store.index')->with('products', $products);
 }
开发者ID:tuananhpham94,项目名称:iFixCenter,代码行数:5,代码来源:StoreController.php

示例14: getIndex

 public function getIndex()
 {
     $data = array('products' => Product::orderBy('id', 'DESC')->paginate(5));
     return View::make('admin.product.index', $data);
 }
开发者ID:kuanblock,项目名称:laravelproject,代码行数:5,代码来源:ProductController.php

示例15: listProducts

 public function listProducts()
 {
     $products = Product::orderBy('code')->get();
     return View::make("product", array("products" => $products));
 }
开发者ID:elioth010,项目名称:carretilla_online,代码行数:5,代码来源:ProductController.php


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