本文整理汇总了PHP中app\Employee::yourManagers方法的典型用法代码示例。如果您正苦于以下问题:PHP Employee::yourManagers方法的具体用法?PHP Employee::yourManagers怎么用?PHP Employee::yourManagers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Employee
的用法示例。
在下文中一共展示了Employee::yourManagers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: single
public function single($mr, $currentMonth)
{
$actualVisits = [];
$MonthlyCustomerProducts = [];
$MRLine = [];
$doctors = Customer::where('mr_id', $mr)->get();
foreach ($doctors as $singleDoctor) {
$actualVisits[$singleDoctor->id] = Report::where('mr_id', $mr)->where('month', $currentMonth)->where('doctor_id', $singleDoctor->id)->count();
$MonthlyCustomerProducts[$singleDoctor->id] = Customer::monthlyProductsBought([$singleDoctor->id])->toArray();
}
$products = Product::where('line_id', Employee::findOrFail($mr)->line_id)->get();
$coverageStats = Employee::coverageStats($mr, $currentMonth);
$allManagers = Employee::yourManagers($mr);
$totalProducts = Employee::monthlyDirectSales($mr, $currentMonth);
$totalSoldProductsSales = $totalProducts['totalSoldProductsSales'];
$totalSoldProductsSalesPrice = $totalProducts['totalSoldProductsSalesPrice'];
$currentMonth = \Carbon\Carbon::parse($currentMonth);
$lines = MrLines::select('line_id', 'from', 'to')->where('mr_id', $mr)->get();
foreach ($lines as $line) {
$lineFrom = \Carbon\Carbon::parse($line->from);
$lineTo = \Carbon\Carbon::parse($line->to);
if (!$currentMonth->lte($lineTo) && $currentMonth->gte($lineFrom)) {
$MRLine = MrLines::where('mr_id', $mr)->where('line_id', $line->line_id)->get();
}
}
$dataView = ['doctors' => $doctors, 'MonthlyCustomerProducts' => $MonthlyCustomerProducts, 'actualVisits' => $actualVisits, 'products' => $products, 'totalVisitsCount' => $coverageStats['totalVisitsCount'], 'actualVisitsCount' => $coverageStats['actualVisitsCount'], 'totalMonthlyCoverage' => $coverageStats['totalMonthlyCoverage'], 'allManagers' => $allManagers, 'totalSoldProductsSales' => $totalSoldProductsSales, 'totalSoldProductsSalesPrice' => $totalSoldProductsSalesPrice, 'MRLines' => $MRLine];
return view('am.line.single', $dataView);
}
示例2: create
public function create($doctorId = NULL)
{
$description_names = Customer::distinct()->select('description_name')->where('mr_id', \Auth::user()->id)->get();
$doctors = Customer::where('mr_id', \Auth::user()->id)->get();
$products = Product::where('line_id', Employee::find(\Auth::user()->id)->line_id)->get();
$gifts = Gift::all();
$allManagers = Employee::yourManagers(\Auth::user()->id);
$dataView = ['description_names' => $description_names, 'doctors' => $doctors, 'products' => $products, 'gifts' => $gifts, 'doctorId' => !empty($doctorId) ? $doctorId : '', 'allManagers' => $allManagers];
if (!empty($doctorId)) {
\Session::set('planned_visit', 1);
}
return view('mr.report.create', $dataView);
}