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


PHP Product::count方法代码示例

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


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

示例1: index

	/**
	 * Show the application dashboard to the user.
	 *
	 * @return Response
	 */
	public function index()
	{
		$new_so = Saleorder::where('status','=','0')->count();
		$new_rso = ReturnSaleorder::where('status','=','0')->count();
		$new_po = Purchaseorder::where('status','=','0')->count();
		$new_rpo = ReturnPurchaseorder::where('status','=','0')->count();
		$tong_san_pham = Product::count();
		$begin = date('Y-m-d H:i:s',strtotime(date('d-m-Y')));
		$end = date('Y-m-d H:i:s',strtotime(date('d-m-Y'))-15*86400);

		$doanh_so = Saleorder::addSelect(\DB::raw('sum(sum_amount) as y'))
							->addSelect(\DB::raw('Date(date) as x'))
							->where('status',1)
							->groupBy('x')
							->orderBy('x','desc')
							->limit(7)
							->get()->toArray();
		$arr_x = array();
		foreach ($doanh_so as $key => $value) {
			$arr_x[] = $value['x'];
			$doanh_so[$key]['x'] = date('m-d-Y',strtotime($value['x'])); 
		}
		array_multisort($arr_x,SORT_ASC,$doanh_so);
		$doanh_so = json_encode($doanh_so);

		$this->layout->content = view('dashboard.dashboard',[
							'new_so'	=>	$new_so,
							'new_rso'	=>	$new_rso,
							'new_po'	=>	$new_po,
							'new_rpo'	=>	$new_rpo,
							'tong_san_pham'=>	$tong_san_pham, 
							'doanh_so'	=>	$doanh_so
						]);
	}
开发者ID:kamitori,项目名称:khuongnhi2,代码行数:39,代码来源:HomeController.php

示例2: __construct

 public function __construct()
 {
     $variable2 = Product::count();
     View::share('variable1', $this->variable1);
     View::share('variable2', $variable2);
     View::share('variable3', 'I am Data 3');
     View::share('variable4', ['name' => 'Franky']);
 }
开发者ID:arisros,项目名称:drope.com,代码行数:8,代码来源:BaseController.php

示例3: index

 public function index()
 {
     \App\Gini\Gapper\Client::init();
     if (\App\Gini\Gapper\Client::getUserName()) {
         return view('dashboard', ['products_count' => Product::count(), 'servers_count' => Server::count(), 'clients_count' => Client::where('parent_id', 0)->count(), 'projects_count' => Project::count()]);
     }
     return view('login');
 }
开发者ID:genee-projects,项目名称:snail,代码行数:8,代码来源:DashboardController.php

示例4: run

 public function run()
 {
     $faker = Faker::create();
     $categoriesIds = Category::lists('id')->all();
     $ProductsIds = Product::lists('id')->all();
     foreach (range(1, Product::count()) as $index) {
         DB::table('category_product')->insert(['category_id' => $faker->randomElement($categoriesIds), 'product_id' => $index]);
     }
 }
开发者ID:alons182,项目名称:guanacastevende,代码行数:9,代码来源:CategoriesProductsTableSeeder.php

示例5: index

 public function index()
 {
     $count_hodon = Hoadon::count();
     $count_sanpham = Product::count();
     $count_danhgia = Danhgia::count();
     $product = Product::orderBy('id', 'DESC')->take(3)->get()->toArray();
     $donhang = Hoadon::orderBy('id', 'DESC')->take(4)->get();
     return view('backend.home', compact('count_hodon', 'count_sanpham', 'count_danhgia', 'product', 'donhang'));
 }
开发者ID:nguyentandat43,项目名称:booksonline,代码行数:9,代码来源:TrangchuContronller.php

示例6: adminDashboard

 public function adminDashboard()
 {
     $page = 'partials.admin-dashboard';
     $users = User::all();
     $user_count = User::count();
     $product_count = Product::count();
     $brand_count = Brand::count();
     $type_count = Type::count();
     return view('quantri/admin', compact('page', 'users', 'user_count', 'product_count', 'brand_count', 'type_count'));
 }
开发者ID:huyle2607,项目名称:eCommerce-Laravel-5.1,代码行数:10,代码来源:PagesController.php

示例7: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $raw = array_map('str_getcsv', file('data.csv'));
     $data = array_slice($raw, 1);
     foreach ($data as $row) {
         $location = Location::firstOrCreate(['county' => $this->county($row[0]), 'city' => $this->city($row[1]), 'state' => $this->state($row[0])]);
         $product = Product::create(['name' => $row[2], 'freight' => $this->float($row[4]), 'margin' => $this->float($row[5]), 'delivered_price' => $this->float($row[6]), 'location_id' => $location->id]);
     }
     $this->info(sprintf("Imported %d locations and %d products\r", Location::count(), Product::count()));
 }
开发者ID:baudday,项目名称:sagar,代码行数:15,代码来源:ImportData.php

示例8: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $this->comment(sprintf("Deleting %d products and %d locations", Product::count(), Location::count()));
     Product::all()->each(function ($doc) {
         $doc->delete();
     });
     Location::all()->each(function ($doc) {
         $doc->delete();
     });
 }
开发者ID:baudday,项目名称:sagar,代码行数:15,代码来源:DataRollback.php

示例9: view_products

 public function view_products()
 {
     $data = [];
     if (Product::count() > 0) {
         $data['results'] = Product::orderBy('caption', 'asc')->get();
         return response()->json($data, 200);
     } else {
         $data['results'] = "No data fund";
         return response()->json($data, 404);
     }
 }
开发者ID:saidur92,项目名称:Laravel-basic-curd-by-me,代码行数:11,代码来源:apiController.php

示例10: getList

 public function getList(Request $request, $type = 'all')
 {
     $perpage = 20;
     $products = Product::orderBy('product_type', 'ASC')->orderBy('product_sort', 'ASC');
     $allCount = Product::count();
     $onlineCount = Product::where('product_active', '=', '1')->count();
     $offlineCount = Product::where('product_active', '=', '0')->count();
     if ($type == 'online') {
         $products = $products->where('product_active', '=', '1');
     } elseif ($type == 'offline') {
         $products = $products->where('product_active', '=', '0');
     }
     $products = $products->paginate($perpage);
     session(['previousUrl' => URL::full()]);
     return view('manage.product.list', ['TITLE' => '产品列表', 'META_KEYWORDS' => META_KEYWORDS, 'META_DESC' => META_DESC, 'PAGE_CODE' => '/manage/product/list', 'type' => $type, 'products' => $products, 'allCount' => $allCount, 'onlineCount' => $onlineCount, 'offlineCount' => $offlineCount]);
 }
开发者ID:verchielxy,项目名称:jiedenuo,代码行数:16,代码来源:ProductController.php

示例11: index

 public function index()
 {
     $dataView = ['productsCount' => Product::count(), 'plansCount' => Plan::where('month', \Config::get('app.current_month'))->count(), 'reportsCount' => Report::where('month', \Config::get('app.current_month'))->count(), 'customersCount' => Customer::count(), 'employeesCount' => Employee::count()];
     return view('admin.index', $dataView);
 }
开发者ID:m-gamal,项目名称:crm,代码行数:5,代码来源:DashboardController.php

示例12: index

 public function index()
 {
     $username = Auth::user()->name;
     $data = array('users' => App\Users::count(), 'products' => App\Product::count(), 'orders' => App\Order::count(), 'producers' => App\Producer::count());
     return view('admin.dashboard.index', compact('data'))->with(['username' => $username]);
 }
开发者ID:dhduc,项目名称:shopui,代码行数:6,代码来源:DashboardController.php

示例13: about_us_data

 public function about_us_data($domain)
 {
     $gen = Gen::getCurrentGen();
     $classes = $gen->studyclasses()->where('name', 'like', '%.%')->count();
     $student = Register::where('code', '!=', null)->count() + 2000;
     $posts = Product::count() + 4000;
     return $this->respond(['gen' => ['name' => $gen->name, 'detail' => $gen->detail], 'studentsNumber' => $student, 'classesNumber' => $classes, 'postsNumber' => $posts]);
 }
开发者ID:Kaelcao,项目名称:colormev2,代码行数:8,代码来源:PublicApiController.php


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