Beispiel #1
0
 public function isDoctorVisited($doctorId, $date)
 {
     $visited = AMReport::where('am_id', \Auth::user()->id)->where('doctor_id', $doctorId)->where('date', '>=', $date)->count();
     if ($visited > 0) {
         return true;
     }
 }
Beispiel #2
0
 public function listAll()
 {
     $employees = Employee::select('id')->where('manager_id', \Auth::user()->id)->get();
     $MRReports = Report::whereIn('mr_id', $employees)->get();
     $yourReports = AMReport::where('am_id', \Auth::user()->id)->get();
     $dataView = ['MRReports' => $MRReports, 'yourReports' => $yourReports];
     return view('am.report.list', $dataView);
 }
Beispiel #3
0
 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);
 }