本文整理汇总了PHP中app\Client::Where方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::Where方法的具体用法?PHP Client::Where怎么用?PHP Client::Where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Client
的用法示例。
在下文中一共展示了Client::Where方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index(Request $request)
{
if ($request->ajax()) {
$client_id = Input::get('filter-client');
$debtor_id = Input::get('filter-debtor');
$registry = Input::get('filter-registry');
$choice = Input::get('filter-choice');
$commissions = DailyChargeCommission::query();
$commissions->where('handler', true);
if ($client_id != 0) {
$commissions->whereHas('delivery', function ($q) use($client_id) {
$q->where('client_id', '=', $client_id);
});
}
if ($debtor_id != 0) {
$commissions->whereHas('delivery', function ($q) use($debtor_id) {
$q->where('debtor_id', '=', $debtor_id);
});
}
if ($registry != 0) {
$commissions->whereHas('delivery', function ($q) use($registry) {
$q->where('registry', '=', $registry);
});
}
if ($choice != 0) {
$before = Input::get('filter-before');
$after = Input::get('filter-after');
$arratBetween = [$before, $after];
if ($choice == 1) {
$commissions->whereHas('delivery', function ($q) use($arratBetween) {
$q->whereBetween('date_of_registry', $arratBetween);
});
} elseif ($choice == 2) {
$commissions->whereBetween('created_at', $arratBetween);
}
}
$commissions = $commissions->get();
return view('reportRepayment.tableRow', ['commissions' => $commissions]);
} else {
$clients = Client::Where('active', true)->get();
$debtors = Debtor::all();
$debtors = Debtor::all();
$registries = ChargeCommission::Distinct('registry')->lists('registry');
return view('reportRepayment.index', ['clients' => $clients, 'debtors' => $debtors, 'registries' => $registries]);
}
}