Exemplo n.º 1
0
 /**
  * @param Organization $organization
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function organizationPage(Organization $organization)
 {
     $workers = null;
     $snapshot = Snapshot::where('organization_id', $organization->id)->orderBy('id', 'desc')->first();
     if (!is_null($snapshot)) {
         $workers = Worker::where('snapshot_id', $snapshot->id)->get();
         $workers = Worker::structure($workers);
     }
     $this->getCounters();
     return view('site.organization', ['organization' => $organization, 'snapshot' => $snapshot, 'workers' => $workers, 'fixed' => true]);
 }
Exemplo n.º 2
0
 /**
  * Список работников
  * @param Organization $organization
  * @param Snapshot $snapshot
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function snapshotPage(Organization $organization, Snapshot $snapshot)
 {
     $workers = Worker::where('snapshot_id', $snapshot->id)->get();
     $workers = Worker::structure($workers);
     return view('admin.organization.workers', ['organization' => $organization, 'snapshot' => $snapshot, 'workers' => $workers, 'menu' => 'workers']);
 }