本文整理汇总了PHP中app\Branch::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Branch::where方法的具体用法?PHP Branch::where怎么用?PHP Branch::where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Branch
的用法示例。
在下文中一共展示了Branch::where方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
$company = Company::find($id);
$branches = Branch::where("company_id", "=", $company->id)->get();
$stacks = Invoicingstack::where("company_id", "=", $company->id)->where("status", "=", 0)->get();
$stack2s = Invoicingstack::where("company_id", "=", $company->id)->get();
$invoice = Bill::where("company_id", "=", $company->id)->get();
$invoiceGroup = Bill::where("company_id", "=", $company->id)->groupBy("invoice_date")->get();
return View("company.companydetail", ['invGp' => $invoiceGroup, 'stacks' => $stacks, 'stack2s' => $stack2s, 'invoices' => $invoice, 'company' => $company, 'branches' => $branches, 'title' => 'Company Detail']);
}
示例2: __construct
public function __construct(Branch $branch, State $state, District $district)
{
$this->branch = $branch->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account'));
$this->district = $district->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account'));
$this->state = $state->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account'));
}
示例3: getTestDrive
public function getTestDrive($id, $table)
{
$branches = Branch::all();
$currentGuest = Que::where('table_id', $table)->orderBy('the_time')->limit(1)->first();
if (isset($currentGuest->guest_id)) {
$items = Guest::find($currentGuest->guest_id);
} else {
$items = null;
}
Storage::disk('local')->put($table . '.json', json_encode($items));
$testDriveBranches = Branch::where('position_id', 3)->get();
return view('testDrive.index')->with(['branches' => $branches, 'file' => $table . '.json', 'table' => $table, 'branche' => $id, 'testDriveBranches' => $testDriveBranches]);
}
示例4: supprimer
public function supprimer()
{
if (\Request::ajax()) {
$numbers = substr(\Input::get('boxes'), 0, -1);
$ids = explode(',', $numbers);
$ids = array_unique($ids);
foreach ($ids as $id) {
$b = Branch::where('user_id', \Auth::user()->id)->where('id', $id)->first();
$b->delete();
}
}
}
示例5: __construct
public function __construct(IssueVoucher $issuevoucher, Branch $branch, Validator $validator)
{
$this->issuevoucher = $issuevoucher->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account'));
$this->branch = $branch->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account'));
$this->validator = $validator;
}
示例6:
Actions
<i class="fa fa-angle-down "></i>
</a>
<ul class="dropdown-menu menu_actions">
<li><a id="delete-ts" href="#"><i class="fa fa-trash-o"></i>Supprimer</a></li>
<!--<li><a href="#"><i class="fa fa-archive"></i>Archiver</a></li>-->
</ul>
</div>
<div class="btn-group hidden-phone">
<a data-toggle="dropdown" href="#" class="btn mini blue">
Trier par branche
<i class="fa fa-angle-down "></i>
</a>
<ul class="br-action dropdown-menu menu_actions">
<?php
$branches = \App\Branch::where('user_id', \Auth::user()->id)->get();
?>
@foreach($branches as $b)
<li><a href="#">{{ $b->nom_branche }}</a></li>
@endforeach
</ul>
</div>
</div>
<ul class="unstyled inbox-pagination liste_arrow">
<li>
示例7: getBranches
public function getBranches()
{
$branches = Branch::where('status', '=', 'Activate')->get();
return $branches;
}
示例8: trierparbranche
public function trierparbranche()
{
if (\Request::ajax()) {
$branch_id = \Input::get('branch_id');
$branches = Branch::where('user_id', \Auth::user()->id)->where('id', $branch_id)->first();
foreach ($branches->classrooms as $branch) {
if ($branch->niveau) {
$niveau = \Auth::user()->leslevels()->where('id', $branch->niveau)->first()->niveau;
} else {
$niveau = '--';
}
if ($branch->branche) {
$branche = \Auth::user()->branches()->where('id', $branch->branche)->first()->nom_branche;
} else {
$branche = '--';
}
echo '<tr>
<td class="no-print"><div class="minimal single-row">
<div class="checkbox_liste ">
<input type="checkbox" value="' . $branch->id . ' " name="select[]">
</div>
</div></td>
<td> ' . $branch->nom_classe . ' </td>
<td> ' . $branch->code_classe . '</td>
<td> ' . $branch->capacite_classe . ' élèves</td>
<td>' . $branch->children()->CurrentYear()->count() . '</td>
<td> ' . $niveau . '</td>
<td>' . $branche . '</td>
<td class="no-print">
<a href="' . action('ClassroomsController@delete', [$branch]) . '" class="actions_icons delete-classe">
<i class="fa fa-trash-o liste_icons"></i></a>
<!--<a href="#"><i class="fa fa-archive liste_icons"></i>
</a>-->
</td>
<td class="no-print"><a href="' . action('ClassroomsController@indexelc', [$branch]) . '"><div class="btn_details">Détails</div></a></td>
</tr>';
}
}
}
示例9: __construct
public function __construct(Godown $godown, Branch $branch, Party $party)
{
$this->branch = $branch->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account'));
$this->party = $party->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account'));
$this->godown = $godown->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account'));
}
示例10: generateInvoice
public function generateInvoice(Request $request, $id = "")
{
$input = $request->all();
$company = !empty($id) ? Company::find($id) : Company::find($input['company_id']);
$ArrMain = [];
// print_r($input);
if (count($input) > 0) {
//allow room for invoice to be processed for recent uploaded and date range
$stacks = Invoicingstack::where("company_id", "=", $company->id)->where("status", "=", 0)->get();
// var_dump("ok ok");
} else {
$stacks = Invoicingstack::where("company_id", "=", $company->id)->where("status", "=", 0)->get();
}
//$input['id']=$id;
$total = 0;
$bill = new Bill();
$invoiceno = "";
if (count($stacks) > 0) {
$bill_no = $bill->genInvoiceNo($company->id) > 0 ? $bill->genInvoiceNo($company->id) : "01";
$invoiceno = !empty($input['inv_no']) && $input['inv_no'] != "" ? "RJLEX/" . strtoupper(substr($company->name, 0, 3)) . "/" . $input['inv_no'] : "RJLEX/" . strtoupper(substr($company->name, 0, 3)) . "/" . str_pad($bill_no, 3, "0", STR_PAD_LEFT);
$bill->invoice_no = $invoiceno;
$bill->created_at = date("Y-m-d H:i:s");
$bill->updated_at = date("Y-m-d H:i:s");
$bill->company_id = $company->id;
$bill->invoice_date = date("Y-m-d H:i:s");
$check = Bill::where("invoice_no", "=", $invoiceno)->pluck("invoice_no");
if (!empty($check)) {
echo "Invoice number already existing in database";
exit;
}
$bill->save();
//$invoiceno = "RJLEX/".strtoupper(substr($company->name,0,3))."/".$bill->genInvoiceNo();
}
$dateFrom = "2000-01-01";
$dateTo = "2000-01-01";
$objPHPExcel = new \PHPExcel();
$m = 0;
$s = 0;
foreach ($stacks as $stack) {
// Create a new worksheet called “My Data”
$s++;
$sheetName = "RJLEX_" . strtoupper(substr($company->name, 0, 3)) . "_" . $bill_no;
$siteName = Branch::where("id", "=", $stack->site_id)->pluck("name");
$myWorkSheet = new \PHPExcel_Worksheet($objPHPExcel, $siteName);
$objPHPExcel->addSheet($myWorkSheet, $m);
/**/
$objPHPExcel->setActiveSheetIndex($m);
$m++;
$site = "";
$siteName = "";
$description = "";
$printNo = 0;
$copyNo = 0;
/**
* For each loop of the invoicing table,
* compute the cost of each print job and populate/create
* the invoice detail table
*/
$a3Arr = [];
$a4Arr = [];
$sumNoPagesA3Color = 0;
//+= $minvoice->number_of_pages;
$sumAmountA3Color = 0;
//$amount;
$sumNoPagesA4Color = 0;
// $minvoice->number_of_pages;
$sumAmountA4Color = 0;
//$amount;
$sumNoPagesA3Mono = 0;
// $minvoice->number_of_pages;
$sumAmountA3Mono = 0;
$sumNoPagesA4Mono = 0;
//0 $minvoice->number_of_pages;
$sumAmountA4Mono = 0;
//$amount;
$sumTotal = 0;
$unitCostA3Mono = 0;
$unitCostA4Mono = 0;
$unitCostA3Color = 0;
$unitCostA4Color = 0;
$x = 1;
$p = 1;
if (count($input) > 0) {
$invoicing = DB::table("invoicing")->where("stack_id", "=", $stack->id)->get();
//->where("final_date",">=",$input['date_from'])->where("final_date","<=","date_to")
} else {
$invoicing = DB::table("invoicing")->where("stack_id", "=", $stack->id)->get();
}
//$dateFrom = DB::table("invoicing")->where("stack_id","=",$stack->id)->max('final_date'); //DB::table("invoicing")->where()
//$dateTo = DB::table("invoicing")->where("stack_id","=",$stack->id)->min('final_date');
foreach ($invoicing as $minvoice) {
//One Location in loop
$froDate = new \DateTime("2000-01-01");
$toDate = new \DateTime("2000-01-01");
if ($x == 1) {
//$dateFrom = new \DateTime($minvoice->final_date);
//$dateTo = new \DateTime($minvoice->final_date);
$objPHPExcel->getActiveSheet()->setCellValue('A' . $x, "SITE");
$objPHPExcel->getActiveSheet()->setCellValue('B' . $x, "User ID");
$objPHPExcel->getActiveSheet()->setCellValue('C' . $x, "Submit IP");
//.........这里部分代码省略.........
示例11: foreach
foreach ($invoices as $invoice) {
if ($inv->invoice_date == $invoice->invoice_date) {
echo " <li>\n <i class='fa fa-file-text bg-blue'></i>\n <div class='timeline-item'>\n <span class='time'><i class='fa fa-clock-o'></i>" . date_format(date_create($invoice->created_at), "H:i ") . "</span>\n <h3 class='timeline-header'><a href='#'>Invoice</a> generated for " . $invoice->duration . "</h3>\n <div class='timeline-body'>";
echo " <div class='row'>\n <!-- accepted payments column -->\n <div class='col-xs-6'>\n <p><h3>Invoice ID: {$invoice->invoice_no}</h3></p>\n <p>Generated to {$company->name}</p>\n </div><!-- /.col -->\n <div class='col-xs-6'>\n <!-- <p class='lead'>Amount Due 2/22/2014</p>-->\n <div class='table-responsive'>\n <table class='table'>\n <tr>\n <th style='width:50%'>Subtotal:</th>\n <td>₦" . number_format($invoice->subtotal, 2, '.', ',') . "</td>\n </tr>\n <tr>\n <th style='width:50%'>5% VAT:</th>\n <td>₦" . number_format($invoice->tax, 2, '.', ',') . "</td>\n </tr>\n <tr>\n <th>Total:</th>\n <td>₦" . number_format($invoice->total, 2, '.', ',') . "</td>\n </tr>\n </table>\n </div>\n </div>";
echo "</div>\n <div class='timeline-footer'>";
?>
<a href='{{url()}}/invoicexlxs/{{$invoice->file_url}}' class='btn bg-green btn-xs'><i class='fa fa-download'></i> Download Report</a>
<?php
echo "<a href='" . url() . "/invoicing/print/" . $invoice->id . "' target='_blank' class='btn btn-primary btn-xs'> <i class='fa fa-file-o'></i> View Invoice</a>\n <a class='delLink btn btn-danger btn-xs btn-inv-del' dname='{$invoice->duration}' url='/invoicing/deleteinvoice/{$invoice->id}' data-target='#myDelete' data-toggle='modal'><i class='fa fa-trash'></i> Delete</a>\n </div>\n </div>\n </li>";
$invoiceStack = \App\Invoicingstack::where("company_id", "=", $invoice->company_id)->where("created_at", "=", $invoice->created_at)->get();
foreach ($invoiceStack as $stack) {
if (date_format(date_create($inv->invoice_date), "M") == date_format(date_create($stack->created_at), "M")) {
echo "<li>\n <i class='fa fa-upload bg-green'></i>\n <div class='timeline-item'>\n <span class='time'><i class='fa fa-clock-o'></i>" . date_format(date_create($stack->created_at), "H:i") . "</span>\n <h3 class='timeline-header'><a href='#'>File Uploaded For </a>";
echo \App\Branch::where("id", $stack->site_id)->pluck("name");
echo "</h3>\n <div class='timeline-body'>\n <a href=''><i class='fa fa-file-excel-o'></i> {$stack->file_url}</a>\n </div>\n </div>\n </li>";
}
}
}
}
}
}
?>
</ul>
</div><!-- /.tab-pane -->
<div class="tab-pane" id="settings">
<div class="box">
示例12: __construct
public function __construct(IssueLoadingSlip $issueloadingslip, Branch $branch, Validator $validator)
{
$this->issueloadingslip = $issueloadingslip->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account'));
$this->branch = $branch->where('company_id', Auth::user()->company_id)->where('account_year_id', session('account'));
$this->validator = $validator;
}