本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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]);
}
示例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;
}
示例6: deleteByIds
public function deleteByIds($ids)
{
$result = Customer::whereIn('id', $ids)->delete();
return $result;
}
示例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);
}
示例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();
}
}