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


PHP Client::Where方法代码示例

本文整理汇总了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]);
     }
 }
开发者ID:PixelPartyRu,项目名称:erp,代码行数:46,代码来源:ReportRepaymentController.php


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