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


PHP Company::orderBy方法代码示例

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


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

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Requests\UpdateAndSaveCompany $request, Company $company)
 {
     $company->create($request->all());
     \Session::flash('message', 'You have successfully Created ' . $company->name);
     $companies = Company::orderBy('name')->paginate(15);
     $keyword = '';
     return view('company.list', compact('companies', 'keyword'));
 }
开发者ID:keiwerkgvr,项目名称:salesperformanceindicator,代码行数:13,代码来源:TrainingController.php

示例2: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $search = \Request::get('search');
     //<-- we use global request to get the param of URI
     if ($search) {
         $allCompanies = Company::whereRaw('store_name = ?', [$search])->orderBy('id', 'desc')->paginate(5);
     } else {
         $allCompanies = Company::orderBy('id', 'desc')->paginate(5);
     }
     return view('company.index', ['companies' => $allCompanies]);
 }
开发者ID:hmakauskas,项目名称:mda,代码行数:16,代码来源:CompanyController.php

示例3: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Requests\UpdateAndSaveCompany $request, Company $company)
 {
     $request->offsetSet('created_by', Auth::user()->id);
     $request->offsetSet('updated_by', Auth::user()->id);
     $request->offsetSet('status', 'ACTIVE');
     $company->create($request->all());
     $company = DB::table('companies')->where('name', $request->name)->first();
     $password = $request->password;
     $user = new User();
     $request->offsetSet('password', bcrypt($request->password));
     $request->offsetSet('created_by', Auth::user()->id);
     $request->offsetSet('updated_by', Auth::user()->id);
     $request->offsetSet('status', "NEW");
     $request->offsetSet('role_id', "4");
     $request->offsetSet('manager_id', 0);
     $request->offsetSet('company_id', $company->id);
     $user->create($request->all());
     $user = DB::table('users')->where('email', $request->email)->first();
     $goal = parent::assembleGoalSetting();
     $goal->user_id = $user->id;
     $goal->created_by = Auth::user()->id;
     $goal->updated_by = Auth::user()->id;
     $goal->save();
     $userPassword = new UserPassword();
     $userPassword->user_id = $user->id;
     $userPassword->crypt_password = \Crypt::encrypt($password);
     $userPassword->updated_at = new \DateTime();
     $userPassword->created_at = new \DateTime();
     $userPassword->save();
     $contactEmail = $user->email;
     $contactName = $user->first_name . ' ' . $user->last_name;
     Mail::send('emails.hello', array('first_name' => $user->first_name, 'user_name' => $user->email, 'password' => $password), function ($message) use($contactEmail, $contactName) {
         $message->from('no-reply@salesperformanceindicator.com', 'Sales Performance Indicator');
         $message->to($contactEmail, $contactName)->subject('Welcome to Sales Performance Indicator!');
     });
     \Session::flash('message', 'You have successfully Created ' . $company->name);
     $companies = Company::orderBy('name')->paginate(15);
     $keyword = '';
     return view('company.list', compact('companies', 'keyword'));
 }
开发者ID:villar88,项目名称:salesperformanceindicator,代码行数:45,代码来源:CompanyController.php

示例4: index

 /**
  * @return \Illuminate\View\View
  */
 public function index()
 {
     $companies = Company::orderBy('name', 'asc')->paginate(10);
     return view('companies.index', compact('companies'));
 }
开发者ID:johanWP,项目名称:pandora,代码行数:8,代码来源:CompaniesController.php

示例5: anyEntry

	public function anyEntry(Request $request,$id=null)
	{
		if(isset($id) && $id!=null){
			$id_product = $id;
			$product = Product::find($id_product)->toArray();
			session(['current_product' => $product['id']]);
		}else{
			$id_product = session('current_product') !== null ? session('current_product') : 0;
			if($id_product){
				$product = Product::find($id_product)->toArray();
				if(count($product)){
					session(['current_product' => $product['id']]);
				}else{
					$product = Product::get()->last();
					if($product){
						$product= $product->toArray();
						session(['current_product' => $product['id']]);
					}else{
						$product = new Product;
						$product->created_by = \Auth::user()->id;
						$product->save();
						Log::create_log(\Auth::user()->id,'App\Product','Tạo mới sản phẩm số '.$product->id);
						session(['current_product' => $product->id]);
						$product->toArray();
					}
				}
			}else{
				$product = Product::get()->last();
				if($product){
					$product= $product->toArray();
					session(['current_product' => $product['id']]);
				}else{
					$product = new Product;
					$product->created_by = \Auth::user()->id;
					$product->save();
					Log::create_log(\Auth::user()->id,'App\Product','Tạo mới sản phẩm số '.$product->id);
					session(['current_product' => $product->id]);
					$product->toArray();
				}
			}
		}



		//Init array
		$distributes = array();
		$oums = array();
		$producttypes = array();
		$list_instock = array();


		//Get value array
		$distributes = Company::getDistributeList()->get()->toArray();
		$oums = Oum::orderBy('name')->get()->toArray();
		$producttypes = ProductType::get()->toArray();
		if($product['check_in_stock']){
			$list_instock = MProduct::select('m_products.*','product_stocks.in_stock')
						->with('company')->with('oum')
						->where('m_products.product_id','=',session('current_product'))
						->where('module_type','=','in_stock')
						->leftJoin('product_stocks','product_stocks.m_product_id','=','m_products.id')
						->get()->toArray();
		}
		
		$view_list_po = self::getListPo($request);
		$view_list_so = self::getListSo($request);
		$companies = array();
		$companies = Company::orderBy('name')->get()->toArray();
		$arr_create = Product::select('users.name','products.created_at')
					->leftJoin('users','users.id','=','products.created_by')
					->where('products.id','=',$product['id'])
					->get()->first()->toArray();

		$arr_update = Product::select('users.name','products.updated_at')
					->leftJoin('users','users.id','=','products.updated_by')
					->where('products.id','=',$product['id'])
					->get()->first()->toArray();
		$this->layout->arr_create = $arr_create;
		$this->layout->arr_update = $arr_update;
		$list_month =ReceiptMonth::select('month','year')
									->distinct()->where('month','>',0)
									->orderBy('year','DESC')
									->orderBy('month','DESC')
									->get()->toArray();
		
		$this->layout->content=view('product.entry', ['distributes'=>$distributes,
								'oums'=>$oums,
								'producttypes'=>$producttypes,
								'product' => $product,
								'view_list_po'	=> $view_list_po,
								'view_list_so'	=> $view_list_so,
								'list_instock' => $list_instock,
								'companies'	=> $companies,
								'list_month' => $list_month
							        ]);
	}
开发者ID:kamitori,项目名称:khuongnhi2,代码行数:96,代码来源:ProductsController.php

示例6: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $companies = Company::orderBy('id', 'desc')->paginate(12);
     return view('front.companies.index', compact('companies'));
 }
开发者ID:khanhpnk,项目名称:sbds,代码行数:10,代码来源:CompanyController.php

示例7: companys_list

 public function companys_list()
 {
     $companys = Company::orderBy('name')->paginate(10);
     return view('company.list', compact('companys'));
 }
开发者ID:L0rdKras,项目名称:the_clinic,代码行数:5,代码来源:CompanyController.php

示例8: companysToAdd

 public function companysToAdd()
 {
     $companys = Company::orderBy('name')->get();
     $vista = view('patients.listOfCompanys', compact('companys'));
     return $vista;
 }
开发者ID:L0rdKras,项目名称:the_clinic,代码行数:6,代码来源:PatientsController.php

示例9: getAllOrderedByNameAsc

 /**
  * Get all of the companies rodered by name ascending
  *
  * @return Collection
  */
 public function getAllOrderedByNameAsc()
 {
     return Company::orderBy('name', 'asc')->get();
 }
开发者ID:vukanac,项目名称:l5-admin-panel,代码行数:9,代码来源:CompanyRepository.php

示例10: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $companies = \App\Company::orderBy('id', 'DESC')->get();
     return view('pages.company.index')->with('companies', $companies);
 }
开发者ID:raulpulido,项目名称:p4,代码行数:10,代码来源:CompanyController.php


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