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


PHP Customer::whereIn方法代码示例

本文整理汇总了PHP中app\Customer::whereIn方法的典型用法代码示例。如果您正苦于以下问题:PHP Customer::whereIn方法的具体用法?PHP Customer::whereIn怎么用?PHP Customer::whereIn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Customer的用法示例。


在下文中一共展示了Customer::whereIn方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: create

 public function create()
 {
     $employees = Employee::select('id')->where('manager_id', \Auth::user()->id)->get();
     $doctors = Customer::whereIn('mr_id', $employees)->get();
     $dataView = ['doctors' => $doctors];
     return view('am.plan.create', $dataView);
 }
开发者ID:m-gamal,项目名称:crm,代码行数:7,代码来源:PlanController.php

示例2: listAll

 public function listAll()
 {
     $employees = Employee::select('id')->where('manager_id', \Auth::user()->id)->get();
     $customers = Customer::whereIn('mr_id', $employees)->get();
     $dataView = ['customers' => $customers];
     return view('am.customer.list', $dataView);
 }
开发者ID:m-gamal,项目名称:crm,代码行数:7,代码来源:CustomerController.php

示例3: index

 public function index()
 {
     $employees = Employee::select('line_id')->where('manager_id', \Auth::user()->id)->get();
     $products = Product::whereIn('line_id', $employees)->get();
     $employees = Employee::select('id')->where('manager_id', \Auth::user()->id)->get();
     $customers = Customer::whereIn('mr_id', $employees)->get();
     $employees = Employee::where('manager_id', \Auth::user()->id)->get();
     $dataView = ['productsCount' => count($products), 'plansCount' => AMPlan::where('month', \Config::get('app.current_month'))->count(), 'reportsCount' => AMReport::where('month', \Config::get('app.current_month'))->count(), 'customersCount' => count($customers), 'employeesCount' => count($employees)];
     return view('am.index', $dataView);
 }
开发者ID:m-gamal,项目名称:crm,代码行数:10,代码来源:DashboardController.php

示例4: index

 public function index()
 {
     View::share(['sideBar' => NavigatorHelper::getSideBarBE()]);
     $status = Status_orders::all(['name', 'id'])->toArray();
     $newProduct = Cd::whereIn('public_date', [Carbon::today(), Carbon::today()->subDay(3)])->count();
     $newArtist = Artist::whereIn('created_at', [Carbon::today(), Carbon::today()->subDay(3)])->count();
     $newOrder = Order::where('status', Order::PENDING)->count();
     $newCustomer = Customer::whereIn('created_at', [Carbon::today(), Carbon::today()->subDay(3)])->count();
     return view('backend.index')->with(['status' => $status, 'newProduct' => $newProduct, 'newArtist' => $newArtist, 'newOrder' => $newOrder, 'newCustomer' => $newCustomer]);
 }
开发者ID:hungnt167,项目名称:CDShop,代码行数:10,代码来源:BackendController.php

示例5: specialtyCoverageStats

 public function specialtyCoverageStats($mrId)
 {
     $totalVisits = [];
     $actualVisits = [];
     $specialtyCoverage = [];
     $specialty = NULL;
     $counter = 0;
     $allSpecialties = Customer::select('specialty')->where('mr_id', $mrId)->get()->toArray();
     $allCustomersSpecialties = Customer::whereIn('specialty', $allSpecialties)->get()->toArray();
     // Get all medical rep customers specialties
     foreach ($allCustomersSpecialties as $singleCustomer) {
         $allSpecialtyClasses[$singleCustomer['specialty']] = Customer::select('class')->where('specialty', $singleCustomer['specialty'])->get()->toArray();
     }
     // Get all customer classes based on specialty
     foreach ($allSpecialtyClasses as $specialty => $specialtyClasses) {
         // Calculate total visits based on classes and specialty
         foreach ($specialtyClasses as $singleSpecialtyClass) {
             if (isset($totalVisits[$specialty])) {
                 $totalVisits[$specialty] += VisitClass::where('name', $singleSpecialtyClass)->first()->visits_count;
             } else {
                 $totalVisits[$specialty] = VisitClass::where('name', $singleSpecialtyClass)->first()->visits_count;
             }
         }
     }
     // Get all doctors visited
     $doctorsVisited = Report::select('doctor_id')->where('month', date('M-Y'))->where('mr_id', $mrId)->get()->toArray();
     foreach ($doctorsVisited as $singleDoctor) {
         // calculate actual visits
         $specialty = Customer::select('specialty')->findOrFail($singleDoctor)->first()->specialty;
         if (isset($actualVisits[$specialty])) {
             $actualVisits[$specialty] += 1;
         } else {
             $actualVisits[$specialty] = 1;
         }
     }
     foreach ($allCustomersSpecialties as $singleCustomerSpecialty) {
         $specialty = $singleCustomerSpecialty['specialty'];
         $specialtyCoverage[$specialty] = 0;
         if (isset($specialtyCoverage[$specialty]) && isset($actualVisits[$specialty]) && isset($totalVisits[$specialty])) {
             $specialtyCoverage[$specialty] = number_format($actualVisits[$specialty] / $totalVisits[$specialty] * 100, 2);
         }
     }
     foreach ($specialtyCoverage as $specialty => $percentage) {
         if (isset($specialtyCoverage[$specialty])) {
             $stats[$counter]['label'] = $specialty;
             $stats[$counter]['data'] = $percentage;
         }
         $counter++;
     }
     return $stats;
 }
开发者ID:m-gamal,项目名称:crm,代码行数:51,代码来源:LineController.php

示例6: deleteByIds

 public function deleteByIds($ids)
 {
     $result = Customer::whereIn('id', $ids)->delete();
     return $result;
 }
开发者ID:manogi,项目名称:gfw-qm,代码行数:5,代码来源:EloquentCustomerRepository.php

示例7: create

 public function create($doctorId = NULL)
 {
     $AMIds = Employee::select('id')->where('manager_id', 1)->get();
     $employees = Employee::select('id')->whereIn('manager_id', $AMIds)->get();
     $description_names = Customer::distinct()->select('description_name')->whereIn('mr_id', $employees)->get();
     $doctors = Customer::whereIn('mr_id', $employees)->get();
     $employeesLines = Employee::select('line_id')->where('manager_id', 4)->get();
     $products = Product::where('line_id', $employeesLines)->get();
     $gifts = Gift::all();
     $dataView = ['description_names' => $description_names, 'doctors' => $doctors, 'products' => $products, 'gifts' => $gifts, 'doctorId' => !empty($doctorId) ? $doctorId : ''];
     return view('sm.report.create', $dataView);
 }
开发者ID:m-gamal,项目名称:crm,代码行数:12,代码来源:ReportController.php

示例8: ajaxLoad

 public function ajaxLoad(Request $request)
 {
     if ($request->get('id')) {
         return Customer::find($request->get('id'));
     } elseif ($request->get('ids')) {
         return Customer::whereIn('id', explode('+', $request->get('ids')))->get();
     } else {
         return Customer::where('kode', 'like', '%' . $request->get('q') . '%')->get();
     }
 }
开发者ID:sopoisun,项目名称:narotser-hadni-kodnop,代码行数:10,代码来源:CustomerController.php


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