本文整理汇总了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'));
}
示例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]);
}
示例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'));
}
示例4: index
/**
* @return \Illuminate\View\View
*/
public function index()
{
$companies = Company::orderBy('name', 'asc')->paginate(10);
return view('companies.index', compact('companies'));
}
示例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
]);
}
示例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'));
}
示例7: companys_list
public function companys_list()
{
$companys = Company::orderBy('name')->paginate(10);
return view('company.list', compact('companys'));
}
示例8: companysToAdd
public function companysToAdd()
{
$companys = Company::orderBy('name')->get();
$vista = view('patients.listOfCompanys', compact('companys'));
return $vista;
}
示例9: getAllOrderedByNameAsc
/**
* Get all of the companies rodered by name ascending
*
* @return Collection
*/
public function getAllOrderedByNameAsc()
{
return Company::orderBy('name', 'asc')->get();
}
示例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);
}