本文整理汇总了PHP中app\Client::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::orderBy方法的具体用法?PHP Client::orderBy怎么用?PHP Client::orderBy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Client
的用法示例。
在下文中一共展示了Client::orderBy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clientsByName
static function clientsByName()
{
$clients = Client::orderBy('name')->get(['id', 'name'])->getDictionary();
return array_map(function ($client) {
return $client->name;
}, $clients);
}
示例2: index
public function index()
{
$clients = Client::orderBy('name', 'ASC')->get();
$debtors = Debtor::orderBy('name', 'ASC')->get();
$relations = Relation::all();
$tariffs = Tariff::all();
return view('relations.index', ['relations' => $relations, 'clients' => $clients, 'tariffs' => $tariffs, 'debtors' => $debtors]);
}
示例3: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$service = Service::findOrFail($id);
$currencies = ['hrk' => 'HRK', 'usd' => 'USD', 'eur' => 'EUR'];
$clients = Client::orderBy('name')->pluck('name', 'id')->toArray();
$categories = Category::orderBy('name')->pluck('name', 'id')->toArray();
return view('services.edit')->with(compact('service', 'currencies', 'clients', 'categories'));
}
示例4: index
public function index()
{
$deliveries = Delivery::all();
$clients = Client::orderBy('name', 'ASC')->get();
$debtors = Debtor::orderBy('name', 'ASC')->get();
$dateToday = Carbon::now()->format('Y-m-d');
$registries = Delivery::orderBy('registry')->lists('registry', 'registry')->toArray();
return view('delivery.index', ['registries' => $registries, 'deliveries' => $deliveries, 'clients' => $clients, 'debtors' => $debtors, 'dateToday' => $dateToday]);
}
示例5: index
/**
* Show the application dashboard to the user.
*
* @return Response
*/
public function index()
{
$expensesss = Expense::where('project_id', '=', 0)->first();
$expensess = Expense::where('project_id', '=', 0)->orderBy('paid_on', 'desc')->get();
$clients = Client::orderBy('created_at', 'desc')->get();
$projects = Project::orderBy('created_at', 'desc')->get();
$expenses = Expense::where('project_id', '>', 0)->orderBy('paid_on', 'desc')->get();
$payments = Payment::orderBy('created_at', 'desc')->get();
$hours = Hour::where('amount_paid', '<', 0)->orderBy('day_worked', 'desc')->get();
return view('home', compact('projects', 'expenses', 'payments', 'hours', 'clients', 'expensess', 'expensesss'));
}
示例6: getUpdate
public function getUpdate($ticketId)
{
$ticket = \App\Ticket::find($ticketId);
$formOptions = [];
$clients = \App\Client::orderBy('name', 'ASC')->get();
$formOptions['client'] = \App\Helpers\FormHelper::objectsToKeyValueArray($clients, 'id', 'name');
$formOptions['client'] = ['' => '--Not Assigned To Client--'] + $formOptions['client'];
$statuses = \App\Status::orderBy('weight', 'ASC')->get();
$formOptions['statuses'] = \App\Helpers\FormHelper::objectsToKeyValueArray($statuses, 'id', 'name');
$formOptions['priorities'] = array_combine(range(1, 10), range(1, 10));
$users = \App\User::all();
$formOptions['users'] = \App\Helpers\FormHelper::objectsToKeyValueArray($users, 'id', 'email');
return view('ticket.edit', ['ticket' => $ticket, 'formOptions' => $formOptions]);
}
示例7: report
/**
* Show the report for all things.
*
* @return [type]
*/
public function report()
{
$services = Service::orderBy('month')->orderBy('day')->where('active', 1)->with(['client', 'category'])->get();
$clients = Client::orderBy('name')->whereHas('services', function ($query) {
$query->where('active', 1);
})->with(['services' => function ($query) {
$query->where('active', 1);
}])->get();
$categories = Category::orderBy('name')->whereHas('services', function ($query) {
$query->where('active', 1);
})->with(['services' => function ($query) {
$query->where('active', 1);
}])->get();
return view('report')->with(compact('services', 'clients', 'categories'));
}
示例8: mealRosterDinner
public function mealRosterDinner()
{
$meals = Meal::orderBy('date_fed', 'desc')->first();
$clients = Client::orderBy('lname', 'asc')->get();
if ($meals->date_fed != date('Y-m-d')) {
foreach ($clients as $client) {
$meals = new Meal();
$meals->date_fed = date('Y-m-d');
$meals->client()->associate($client);
$meals->breakfast = 0;
$meals->lunch = 0;
$meals->dinner = 0;
$meals->save();
}
}
return view('meal.meal_roster_dinner', compact('clients'));
}
示例9: store
public function store()
{
$rules = array('name' => 'required', 'country' => 'required', 'state' => 'required', 'city' => 'required', 'zip' => 'required', 'address' => 'required', 'contact' => 'required', 'phone' => 'required', 'email' => 'required|email', 'website' => 'url');
$validator = Validator::make(Request::all(), $rules);
if ($validator->passes()) {
$store = new Client();
$store->fill(Request::all());
$store->save();
// Reload Table Data
$data_client = array('client' => Client::orderBy('id', 'desc')->get(), 'refresh' => true);
return view('clients.table')->with($data_client);
} else {
if (Request::ajax()) {
return view('clients.create')->withErrors($validator)->withInput(Request::all());
}
return 0;
}
}
示例10: allAppointment
function allAppointment()
{
if (isset($_SESSION['authorization'])) {
if ($_SESSION['authorization'] == 1) {
$clients = Client::orderBy('id', 'DESC')->get();
} else {
$clients = Client::where('doctor_id', $_SESSION['user_id'])->orderBy('id', 'DESC')->get();
}
return view('clients.allAppointment', ['clients' => $clients]);
} else {
//$_SESSION['mesaj'] = '<div class="form-signin" style="background-color:pink;"><center><p style="color:red;">Bu Sayfaya Girme Yetkiniz Yok .</p></center></div>';
return Redirect::to('./sayfa-bulunamadi');
}
}
示例11: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
return view('client.index', ['clients' => Client::orderBy('name')->get()]);
}
示例12: mealsTotal
/**
* @param $stdate
* @param $edate
* @return array
*/
public function mealsTotal($stdate, $edate)
{
$clients = Client::orderBy('lname', 'asc')->get();
$mealTotal = array();
for ($i = 1; $i <= 31; $i++) {
$dayTotal[$i] = 0;
}
foreach ($clients as $client) {
$id = $client->id;
$mealTotal[$id] = 0;
$rowMeals[$id] = $client->meal()->where('date_fed', '>=', $stdate)->where('date_fed', '<', $edate)->get()->toArray();
foreach ($rowMeals[$id] as $row) {
$b = $row['breakfast'];
$l = $row['lunch'];
$d = $row['dinner'];
$mealTotal[$id] += $b + $l + $d;
}
}
return $mealTotal;
}
示例13: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$client = Client::orderBy('updated_at', 'desc')->paginate(50);
return view('admin.client.index', compact('client'));
}
示例14: __construct
public function __construct()
{
$clients = Client::orderBy('name')->lists('name', 'id');
view()->share(['clients' => $clients]);
}
示例15: getIndex
public function getIndex()
{
$clients = \App\Client::orderBy('name', 'ASC')->get();
return view('client.index', ['clients' => $clients]);
}