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


PHP Customer::select方法代码示例

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


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

示例1: totalMonthlyCoverage

 public static function totalMonthlyCoverage()
 {
     $visitClass = Customer::select('class')->where('mr_id', \Auth::user()->id)->get()->toArray();
     $totalVisitsCount = VisitClass::whereIn('name', $visitClass)->sum('visits_count');
     $actualVisitsCount = Report::where('mr_id', \Auth::user()->id)->where('month', date('M') . '-' . date('Y'))->count();
     return number_format($actualVisitsCount / $totalVisitsCount * 100, 2);
 }
开发者ID:m-gamal,项目名称:crm,代码行数:7,代码来源:Customer.php

示例2: search

 public function search()
 {
     $classes = VisitClass::all();
     $specialties = Customer::select('specialty')->distinct()->get();
     $MRs = Employee::where('level_id', 7)->get();
     $dataView = ['classes' => $classes, 'specialties' => $specialties, 'MRs' => $MRs];
     return view('admin.search.coverage.search', $dataView);
 }
开发者ID:m-gamal,项目名称:crm,代码行数:8,代码来源:CoverageController.php

示例3: getNextId

 public static function getNextId()
 {
     $id = Customer::select("customer_id")->orderBy("customer_id", 'decs')->first()->customer_id + 1;
     if ($id) {
         return $id;
     }
     return 1;
 }
开发者ID:znittzel,项目名称:datianew,代码行数:8,代码来源:Customer.php

示例4: tires

 public function tires()
 {
     $customers = Customer::select(["customer_id", "name"])->orderBy('name')->get();
     return view('tire.tires', compact('customers'));
 }
开发者ID:znittzel,项目名称:datianew,代码行数:5,代码来源:TireController.php

示例5: getCustomers

 public function getCustomers()
 {
     return Customer::select(['customer_id', 'name'])->orderBy('name')->get();
 }
开发者ID:znittzel,项目名称:datianew,代码行数:4,代码来源:CustomerController.php

示例6: search

 /**
  * Search Customer function
  */
 public function search(Request $request)
 {
     $keywords = $request->input('keywords');
     $column = ['id', 'created_at', 'owner', 'rego', 'make', 'model', 'colour'];
     $customers = Customer::select($column)->where('owner', 'like', '%' . $keywords . '%')->orWhere('rego', 'like', '%' . $keywords . '%')->orWhere('make', 'like', '%' . $keywords . '%')->orWhere('model', 'like', '%' . $keywords . '%')->orWhere('colour', 'like', '%' . $keywords . '%')->get();
     return view('crashzone.partials.search_result', compact('customers'));
 }
开发者ID:loveisalie92,项目名称:crashzone,代码行数:10,代码来源:CustomerController.php

示例7: create

 public function create()
 {
     $customers = Customer::select(["customer_id", "name"])->orderBy('name')->get();
     return view('order.create_order', compact("customers"));
 }
开发者ID:znittzel,项目名称:datianew,代码行数:5,代码来源:OrderController.php

示例8: 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


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