Blame view
app/Http/Controllers/WorkerController.php
1.2 KB
b52b1df0d Опция поднятия ва... |
1 2 3 4 5 6 7 8 9 10 |
<?php namespace App\Http\Controllers; use App\Models\Static_worker; use App\Models\Worker; use Illuminate\Http\Request; class WorkerController extends Controller { |
5b68533bb Работа над проект... |
11 |
//главная |
b52b1df0d Опция поднятия ва... |
12 |
public function index() { |
5b68533bb Работа над проект... |
13 |
return; |
b52b1df0d Опция поднятия ва... |
14 |
} |
5b68533bb Работа над проект... |
15 |
//профиль |
b52b1df0d Опция поднятия ва... |
16 |
public function profile(Worker $worker) { |
673a7768d Правки в админке,... |
17 |
$get_date = date('Y.m'); |
b52b1df0d Опция поднятия ва... |
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
$c = Static_worker::query()->where('year_month', '=', $get_date) ->where('user_id', '=', $worker->users->id) ->get(); if ($c->count() > 0) { $upd = Static_worker::find($c[0]->id); $upd->lookin = $upd->lookin + 1; $upd->save(); } else { $crt = new Static_worker(); $crt->lookin = 1; $crt->year_month = $get_date; $crt->user_id = $worker->user_id; $crt->save(); } $stat = Static_worker::query()->where('year_month', '=', $get_date) ->where('user_id', '=', $worker->users->id) ->get(); return view('public.workers.profile', compact('worker', 'stat')); } |
5b68533bb Работа над проект... |
41 42 43 44 45 |
//публичная оферта public function public_offer() { return; } |
b52b1df0d Опция поднятия ва... |
46 |
} |