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


PHP Product::select方法代码示例

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


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

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     # returns a list of products in decreasing order by date created
     $products = Product::select('*')->orderBy('created_at', 'desc')->paginate(5);
     return view('skins/skin_b/product/index', ['products' => $products]);
     # return response()->json( Product::all() );
 }
开发者ID:nkiermaier,项目名称:laravel_ecommerce,代码行数:12,代码来源:ProductController.php

示例2: postDetail

 public function postDetail()
 {
     $return['success'] = 0;
     if (Input::has('id')) {
         $product = Product::select('name_en', 'name_id', 'price', 'masked_price', 'promo_label_en', 'promo_label_id', 'image', 'type', 'created_at as cdate')->find(Input::get('id'));
         if ($product !== null) {
             $return['success'] = 1;
             $data['name_en'] = $product->name_en;
             $data['name_id'] = $product->name_id;
             $data['price'] = $product->price;
             $data['image'] = $product->image;
             $data['type'] = $product->type;
             $data['promo_label_en'] = $product->promo_label_en;
             $data['promo_label_id'] = $product->promo_label_id;
             $data['masked_price'] = $product->masked_price;
             $data['created_at'] = $product->cdate;
             $return['data'] = $data;
         }
     }
     echo json_encode($return);
 }
开发者ID:benhanks040888,项目名称:rmyrfl,代码行数:21,代码来源:ProductController.php

示例3: ajaxProduct_enable

 public function ajaxProduct_enable(Request $request)
 {
     $feedId = Input::get('feedid');
     $products = Product::select(array('products.id', 'products.name', 'products.description', 'products.image'))->where('feed_id', Input::get('feedid'));
     return Datatables::of($products)->addColumn('active', function ($products) {
         return '<input type="checkbox" name="disable[]" value="' . $products->id . '">';
     }, 0)->editColumn('image', '<img src="{!! $image !!}" height="50" width="50">')->make();
 }
开发者ID:shihqi,项目名称:fms,代码行数:8,代码来源:FeedProductController.php

示例4: getProductsByFullText

 public function getProductsByFullText($rawQuery, $fields, $orderBy, $paginate = false, $pageSize = 25)
 {
     $arrTerms = $this->prepareFullTextSearchQuery($rawQuery);
     $terms = implode(' ', $arrTerms);
     $query = "MATCH (name, description, gtin, mpc, brand, ingredient_deck) AGAINST ('{$terms}' IN BOOLEAN MODE)";
     if ($paginate) {
         $products = Product::select($fields)->whereRaw($query)->orderBy($orderBy)->paginate($pageSize);
     } else {
         $products = Product::select($fields)->whereRaw($query)->orderBy($orderBy)->get();
     }
     return $products;
 }
开发者ID:gabwhite,项目名称:fsh,代码行数:12,代码来源:DataAccessLayer.php


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