Compare View

switch
from
...
to
 
Commits (7)

Changes

Showing 19 changed files Side-by-side Diff

app/Enums/DbExportColumns.php
... ... @@ -8,10 +8,13 @@ enum DbExportColumns: string
8 8 {
9 9 use EnumToArray;
10 10  
11   - case job_titles__name = 'Должность';
12   - case users__surname = 'Фамилия';
  11 + //case job_titles__code = 'Коды должностей';
  12 + case users__id = 'Код пользователя';
13 13 case users__name_man = 'Имя';
14   - case users__surname2 = 'Отчетство';
15   - case users__email = 'Почта';
  14 + case users__surname = 'Фамилия';
  15 + case users__surname2 = 'Отчество';
  16 + case users__jobs = 'Должности';
  17 + case users__email = 'Email';
16 18 case users__telephone = 'Телефон';
  19 +
17 20 }
app/Http/Controllers/Admin/UsersController.php
... ... @@ -8,6 +8,8 @@ use App\Models\ContentRoles;
8 8 use App\Models\Job_title;
9 9 use App\Models\User;
10 10 use App\Models\Worker;
  11 +use App\Models\worker_jobs;
  12 +use Illuminate\Database\Eloquent\Model;
11 13 use Illuminate\Http\Request;
12 14 use Illuminate\Support\Facades\Auth;
13 15 use Illuminate\Support\Facades\Storage;
... ... @@ -75,13 +77,14 @@ class UsersController extends Controller
75 77 }
76 78  
77 79 public function add_bd() {
78   - $list_job_titles = Job_title::query()->active()->where('is_bd', '=' , '2')->orderBy('name', 'asc')->get();
  80 + $list_job_titles = Job_title::query()->active()->where('is_bd', '=' , '2')->
  81 + orderBy('name', 'asc')->get();
79 82 return view('admin.users.add', compact('list_job_titles'));
80 83 }
81 84  
82 85 public function add_store_bd(BaseUserRequest $request) {
83 86 $params = $request->all();
84   -
  87 + //dd($params);
85 88 if ($request->has('file')) {
86 89 $params['file'] = $request->file('file')->store('basedata', 'public');
87 90 }
... ... @@ -90,12 +93,25 @@ class UsersController extends Controller
90 93 $params['name'] = $request->surname." ".$request->name_man." ".$request->surname2;
91 94 }
92 95  
93   - $user = User::create($params);
94   - $worker = new Worker();
95   - $worker->positions_work = isset($params['positions_work']) ? json_encode($params['positions_work']) : [];
96   - $worker->user_id = $user->id;
97   - $worker->comment = isset($params['comment']) ? $params['comment'] : null;
98   - $worker->save();
  96 + try {
  97 + $user = User::create($params);
  98 + } finally {
  99 + $worker = new Worker();
  100 + $worker->positions_work = isset($params['positions_work']) ? json_encode($params['positions_work']) : [];
  101 + $worker->user_id = $user->id;
  102 + $worker->comment = isset($params['comment']) ? $params['comment'] : null;
  103 + $worker->save();
  104 +
  105 + /* Отказ от рефакторинга из-за сжатых сроков! Ларионов
  106 + * if (is_array($params['positions_work']))
  107 + foreach ($params['positions_work'] as $it) {
  108 + $worker_job = new worker_jobs();
  109 + $worker_job->user_id = $user->id;
  110 + $worker_job->job_id = $it;
  111 + $worker_job->save();
  112 + }
  113 + */
  114 + }
99 115  
100 116 return redirect()->route('admin.basedata');
101 117 }
... ... @@ -125,18 +141,32 @@ class UsersController extends Controller
125 141 $params['name'] = $request->surname." ".$request->name_man." ".$request->surname2;
126 142 }
127 143  
128   - $user->update($params);
129   - if (isset($user->workers[0]->id)) {
130   - $worker = Worker::find($user->workers[0]->id);
131   - $worker->positions_work = $positions_work;
132   - $worker->comment = isset($params['comment']) ? $params['comment'] : null;
133   - $worker->save();
134   - } else {
135   - $worker = new Worker();
136   - $worker->user_id = $user->id;
137   - $worker->positions_work = $positions_work;
138   - $worker->comment = isset($params['comment']) ? $params['comment'] : null;
139   - $worker->save();
  144 + try {
  145 + $user->update($params);
  146 +
  147 + } finally {
  148 + if (isset($user->workers[0]->id)) {
  149 + $worker = Worker::find($user->workers[0]->id);
  150 + $worker->positions_work = $positions_work;
  151 + $worker->comment = isset($params['comment']) ? $params['comment'] : null;
  152 + $worker->save();
  153 + } else {
  154 + $worker = new Worker();
  155 + $worker->user_id = $user->id;
  156 + $worker->positions_work = $positions_work;
  157 + $worker->comment = isset($params['comment']) ? $params['comment'] : null;
  158 + $worker->save();
  159 + }
  160 + /*
  161 + * Отказ от рефакторинга структуры БД из-за сжатых сроков сдачи. Ларионов.
  162 + if (is_array($params['positions_work']))
  163 + foreach ($params['positions_work'] as $it) {
  164 + worker_jobs::updateOrCreate(
  165 + ['user_id' => $user->id],
  166 + ['job_id' => $it]
  167 + );
  168 + }
  169 + */
140 170 }
141 171  
142 172 return redirect()->route('admin.basedata');
app/Http/Controllers/MainController.php
... ... @@ -67,7 +67,7 @@ class MainController extends Controller
67 67 orderBy('sort')->get();
68 68 $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get();
69 69  
70   - $block_names = MainPageCounters::values();;
  70 + $block_names = MainPageCounters::values();
71 71 $blocks_counters = PageContent::select('name', 'title', 'description', 'extra')
72 72 ->whereIn('name', $block_names)
73 73 ->orderBy('name', 'asc')
app/Http/Controllers/WorkerController.php
... ... @@ -288,6 +288,7 @@ class WorkerController extends Controller
288 288  
289 289 $jobIds = $request->input('job_title_list', []);
290 290  
  291 +
291 292 /* //query for mysql ver 8.0 or higher
292 293 $users = DB::select(
293 294 "select `job_titles`.`name`, `users`.`surname`, `users`.`name_man`, `users`.`surname2`, `users`.`email`, `users`.`telephone`
... ... @@ -304,17 +305,56 @@ class WorkerController extends Controller
304 305 )". ((!empty($jobIds)) ? 'and job_titles.id in ('. implode(',', $jobIds).')' : '')
305 306 );*/
306 307  
307   - $users = DB::select(
  308 + /*$users = DB::select(
308 309 "select `job_titles`.`name`, `users`.`surname`, `users`.`name_man`, `users`.`surname2`, `users`.`email`, `users`.`telephone`
309 310 from users
310 311 join workers on `users`.`id` = `workers`.`user_id`
311 312 join `job_titles`
312   - where `users`.`is_bd` = 1
  313 + where `users`.`is_bd` = 2
313 314 and (`workers`.`position_work` = `job_titles`.`id`
314 315 or `workers`.`positions_work`
315 316 )". ((!empty($jobIds)) ? 'and job_titles.id in ('. implode(',', $jobIds).')' : '')
316   - );
  317 + );*/
  318 +
  319 + /*$users = DB::select("select `job_titles`.`name`, `users`.`surname`, `users`.`name_man`,
  320 + `users`.`surname2`, `users`.`email`, `users`.`telephone`, `users`.`id`, `job_titles`.`id`
  321 + FROM `users`
  322 + JOIN `job_titles`
  323 + JOIN workers ON `users`.id = `workers`.user_id
  324 + JOIN worker_jobs ON `users`.`id` = `worker_jobs`.user_id AND
  325 + `job_titles`.`id` = `worker_jobs`.job_id");
  326 + */
  327 + $first_part = "SELECT
  328 + w.user_id, u.`name`, u.`surname`, u.`surname2`,
  329 + GROUP_CONCAT(j.`name` SEPARATOR ', ') AS job_titles_names,
  330 + u.`email`, u.`telephone`, w.`positions_work`
  331 + FROM
  332 + users u
  333 + INNER JOIN
  334 + Workers w ON u.id = w.user_id
  335 + INNER JOIN
  336 + JSON_TABLE(w.positions_work, '$[*]' COLUMNS (pos INT PATH '$')) AS extracted_positions
  337 + INNER JOIN
  338 + job_titles j ON j.id = extracted_positions.pos";
  339 +
  340 + $second_part = " ";
  341 + if (!is_null($jobIds))
  342 + if (is_array($jobIds))
  343 + if (count($jobIds) > 0)
  344 + {
  345 + $second_part = " WHERE ";
  346 + foreach ($jobIds as $key => $it) {
  347 + if ($key == 0)
  348 + $second_part .= "(j.id = ".$it.") ";
  349 + elseif ($key > 0)
  350 + $second_part .= "OR (j.id = ".$it.") ";
  351 + }
  352 + }
  353 +
  354 + $three_part = "GROUP BY w.user_id, w.positions_work, u.`name`
  355 + HAVING COUNT(DISTINCT j.id) = JSON_LENGTH(w.positions_work)";
317 356  
  357 + $users = DB::select($first_part.$second_part.$three_part);
318 358 $users = collect($users);
319 359  
320 360 if ($users->count()) {
app/Models/Job_title.php
... ... @@ -32,6 +32,14 @@ class Job_title extends Model
32 32 return $this->belongsTo(Job_title::class, 'parent_id');
33 33 }
34 34  
  35 + /*
  36 + * Связь модели Вакансии (Job_title) с моделью Вакансии работника (worker_jobs)
  37 + один-ко-многим
  38 + */
  39 + public function worker_job() {
  40 + return $this->hasMany(worker_jobs::class);
  41 + }
  42 +
35 43 public function scopeActive($query) {
36 44 return $query->where('is_remove', '=', '0');
37 45 }
app/Models/Worker.php
... ... @@ -122,6 +122,14 @@ class Worker extends Model
122 122 )->withPivot('status');
123 123 }
124 124  
  125 + /*
  126 + * Связь модели Работники (Workers) с моделью Вакансии работника (worker_jobs)
  127 + один-ко-многим
  128 + */
  129 + public function worker_job() {
  130 + return $this->hasMany(worker_jobs::class);
  131 + }
  132 +
125 133 //Связи Работника с дополнительными
126 134 public function dop_info() {
127 135 return $this->hasMany(Dop_info::class, 'worker_id');
app/Models/worker_jobs.php
... ... @@ -0,0 +1,34 @@
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Database\Eloquent\Factories\HasFactory;
  6 +use Illuminate\Database\Eloquent\Model;
  7 +
  8 +class worker_jobs extends Model
  9 +{
  10 + use HasFactory;
  11 +
  12 + protected $fillable = [
  13 + 'id',
  14 + 'user_id',
  15 + 'job_id'
  16 + ];
  17 +
  18 + /*
  19 + * Связь таблицы users с таблицей worker_jobs
  20 + многие-к-одному
  21 + */
  22 + public function users() {
  23 + return $this->belongsTo(User::class, 'user_id');
  24 + }
  25 +
  26 + /*
  27 + * Связь таблицы Job_titles с таблицей worker_jobs
  28 + многие-к-одному
  29 + */
  30 + public function job_titles() {
  31 + return $this->belongsTo(Job_title::class, 'job_id');
  32 + }
  33 +
  34 +}
... ... @@ -7,7 +7,7 @@
7 7 "require": {
8 8 "php": "^8.0.2",
9 9 "barryvdh/laravel-dompdf": "^2.1",
10   - "doctrine/dbal": "3.0",
  10 + "doctrine/dbal": "^4.1",
11 11 "filament/forms": "^2.17",
12 12 "filament/notifications": "^2.17",
13 13 "filament/tables": "^2.17",
... ... @@ -4,7 +4,7 @@
4 4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5 5 "This file is @generated automatically"
6 6 ],
7   - "content-hash": "a7eb5dd83a46d4d36bcfd6dc5e419b75",
  7 + "content-hash": "3ec5ac1b1672ef52de708476e39931cf",
8 8 "packages": [
9 9 {
10 10 "name": "akaunting/laravel-money",
... ... @@ -757,146 +757,44 @@
757 757 "time": "2024-07-08T12:26:09+00:00"
758 758 },
759 759 {
760   - "name": "doctrine/cache",
761   - "version": "1.13.0",
762   - "source": {
763   - "type": "git",
764   - "url": "https://github.com/doctrine/cache.git",
765   - "reference": "56cd022adb5514472cb144c087393c1821911d09"
766   - },
767   - "dist": {
768   - "type": "zip",
769   - "url": "https://api.github.com/repos/doctrine/cache/zipball/56cd022adb5514472cb144c087393c1821911d09",
770   - "reference": "56cd022adb5514472cb144c087393c1821911d09",
771   - "shasum": ""
772   - },
773   - "require": {
774   - "php": "~7.1 || ^8.0"
775   - },
776   - "conflict": {
777   - "doctrine/common": ">2.2,<2.4"
778   - },
779   - "require-dev": {
780   - "alcaeus/mongo-php-adapter": "^1.1",
781   - "cache/integration-tests": "dev-master",
782   - "doctrine/coding-standard": "^9",
783   - "mongodb/mongodb": "^1.1",
784   - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
785   - "predis/predis": "~1.0",
786   - "psr/cache": "^1.0 || ^2.0 || ^3.0",
787   - "symfony/cache": "^4.4 || ^5.4 || ^6",
788   - "symfony/var-exporter": "^4.4 || ^5.4 || ^6"
789   - },
790   - "suggest": {
791   - "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver"
792   - },
793   - "type": "library",
794   - "autoload": {
795   - "psr-4": {
796   - "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
797   - }
798   - },
799   - "notification-url": "https://packagist.org/downloads/",
800   - "license": [
801   - "MIT"
802   - ],
803   - "authors": [
804   - {
805   - "name": "Guilherme Blanco",
806   - "email": "guilhermeblanco@gmail.com"
807   - },
808   - {
809   - "name": "Roman Borschel",
810   - "email": "roman@code-factory.org"
811   - },
812   - {
813   - "name": "Benjamin Eberlei",
814   - "email": "kontakt@beberlei.de"
815   - },
816   - {
817   - "name": "Jonathan Wage",
818   - "email": "jonwage@gmail.com"
819   - },
820   - {
821   - "name": "Johannes Schmitt",
822   - "email": "schmittjoh@gmail.com"
823   - }
824   - ],
825   - "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.",
826   - "homepage": "https://www.doctrine-project.org/projects/cache.html",
827   - "keywords": [
828   - "abstraction",
829   - "apcu",
830   - "cache",
831   - "caching",
832   - "couchdb",
833   - "memcached",
834   - "php",
835   - "redis",
836   - "xcache"
837   - ],
838   - "support": {
839   - "issues": "https://github.com/doctrine/cache/issues",
840   - "source": "https://github.com/doctrine/cache/tree/1.13.0"
841   - },
842   - "funding": [
843   - {
844   - "url": "https://www.doctrine-project.org/sponsorship.html",
845   - "type": "custom"
846   - },
847   - {
848   - "url": "https://www.patreon.com/phpdoctrine",
849   - "type": "patreon"
850   - },
851   - {
852   - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache",
853   - "type": "tidelift"
854   - }
855   - ],
856   - "time": "2022-05-20T20:06:54+00:00"
857   - },
858   - {
859 760 "name": "doctrine/dbal",
860   - "version": "3.0.0",
  761 + "version": "4.1.1",
861 762 "source": {
862 763 "type": "git",
863 764 "url": "https://github.com/doctrine/dbal.git",
864   - "reference": "ee6d1260d5cc20ec506455a585945d7bdb98662c"
  765 + "reference": "7a8252418689feb860ea8dfeab66d64a56a64df8"
865 766 },
866 767 "dist": {
867 768 "type": "zip",
868   - "url": "https://api.github.com/repos/doctrine/dbal/zipball/ee6d1260d5cc20ec506455a585945d7bdb98662c",
869   - "reference": "ee6d1260d5cc20ec506455a585945d7bdb98662c",
  769 + "url": "https://api.github.com/repos/doctrine/dbal/zipball/7a8252418689feb860ea8dfeab66d64a56a64df8",
  770 + "reference": "7a8252418689feb860ea8dfeab66d64a56a64df8",
870 771 "shasum": ""
871 772 },
872 773 "require": {
873   - "composer/package-versions-deprecated": "^1.11.99",
874   - "doctrine/cache": "^1.0",
875   - "doctrine/event-manager": "^1.0",
876   - "php": "^7.3 || ^8.0"
  774 + "doctrine/deprecations": "^0.5.3|^1",
  775 + "php": "^8.1",
  776 + "psr/cache": "^1|^2|^3",
  777 + "psr/log": "^1|^2|^3"
877 778 },
878 779 "require-dev": {
879   - "doctrine/coding-standard": "^8.1",
880   - "jetbrains/phpstorm-stubs": "^2019.1",
881   - "phpstan/phpstan": "^0.12.40",
882   - "phpstan/phpstan-strict-rules": "^0.12.2",
883   - "phpunit/phpunit": "^9.4",
884   - "psalm/plugin-phpunit": "^0.10.0",
885   - "symfony/console": "^2.0.5|^3.0|^4.0|^5.0",
886   - "vimeo/psalm": "^3.17.2"
  780 + "doctrine/coding-standard": "12.0.0",
  781 + "fig/log-test": "^1",
  782 + "jetbrains/phpstorm-stubs": "2023.2",
  783 + "phpstan/phpstan": "1.12.0",
  784 + "phpstan/phpstan-phpunit": "1.4.0",
  785 + "phpstan/phpstan-strict-rules": "^1.6",
  786 + "phpunit/phpunit": "10.5.30",
  787 + "psalm/plugin-phpunit": "0.19.0",
  788 + "slevomat/coding-standard": "8.13.1",
  789 + "squizlabs/php_codesniffer": "3.10.2",
  790 + "symfony/cache": "^6.3.8|^7.0",
  791 + "symfony/console": "^5.4|^6.3|^7.0",
  792 + "vimeo/psalm": "5.25.0"
887 793 },
888 794 "suggest": {
889 795 "symfony/console": "For helpful console commands such as SQL execution and import of files."
890 796 },
891   - "bin": [
892   - "bin/doctrine-dbal"
893   - ],
894 797 "type": "library",
895   - "extra": {
896   - "branch-alias": {
897   - "dev-master": "4.0.x-dev"
898   - }
899   - },
900 798 "autoload": {
901 799 "psr-4": {
902 800 "Doctrine\\DBAL\\": "src"
... ... @@ -948,7 +846,7 @@
948 846 ],
949 847 "support": {
950 848 "issues": "https://github.com/doctrine/dbal/issues",
951   - "source": "https://github.com/doctrine/dbal/tree/3.0.0"
  849 + "source": "https://github.com/doctrine/dbal/tree/4.1.1"
952 850 },
953 851 "funding": [
954 852 {
... ... @@ -964,7 +862,7 @@
964 862 "type": "tidelift"
965 863 }
966 864 ],
967   - "time": "2020-11-15T18:20:41+00:00"
  865 + "time": "2024-09-03T08:58:39+00:00"
968 866 },
969 867 {
970 868 "name": "doctrine/deprecations",
... ... @@ -1014,98 +912,6 @@
1014 912 "time": "2024-01-30T19:34:25+00:00"
1015 913 },
1016 914 {
1017   - "name": "doctrine/event-manager",
1018   - "version": "1.2.0",
1019   - "source": {
1020   - "type": "git",
1021   - "url": "https://github.com/doctrine/event-manager.git",
1022   - "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520"
1023   - },
1024   - "dist": {
1025   - "type": "zip",
1026   - "url": "https://api.github.com/repos/doctrine/event-manager/zipball/95aa4cb529f1e96576f3fda9f5705ada4056a520",
1027   - "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520",
1028   - "shasum": ""
1029   - },
1030   - "require": {
1031   - "doctrine/deprecations": "^0.5.3 || ^1",
1032   - "php": "^7.1 || ^8.0"
1033   - },
1034   - "conflict": {
1035   - "doctrine/common": "<2.9"
1036   - },
1037   - "require-dev": {
1038   - "doctrine/coding-standard": "^9 || ^10",
1039   - "phpstan/phpstan": "~1.4.10 || ^1.8.8",
1040   - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
1041   - "vimeo/psalm": "^4.24"
1042   - },
1043   - "type": "library",
1044   - "autoload": {
1045   - "psr-4": {
1046   - "Doctrine\\Common\\": "src"
1047   - }
1048   - },
1049   - "notification-url": "https://packagist.org/downloads/",
1050   - "license": [
1051   - "MIT"
1052   - ],
1053   - "authors": [
1054   - {
1055   - "name": "Guilherme Blanco",
1056   - "email": "guilhermeblanco@gmail.com"
1057   - },
1058   - {
1059   - "name": "Roman Borschel",
1060   - "email": "roman@code-factory.org"
1061   - },
1062   - {
1063   - "name": "Benjamin Eberlei",
1064   - "email": "kontakt@beberlei.de"
1065   - },
1066   - {
1067   - "name": "Jonathan Wage",
1068   - "email": "jonwage@gmail.com"
1069   - },
1070   - {
1071   - "name": "Johannes Schmitt",
1072   - "email": "schmittjoh@gmail.com"
1073   - },
1074   - {
1075   - "name": "Marco Pivetta",
1076   - "email": "ocramius@gmail.com"
1077   - }
1078   - ],
1079   - "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.",
1080   - "homepage": "https://www.doctrine-project.org/projects/event-manager.html",
1081   - "keywords": [
1082   - "event",
1083   - "event dispatcher",
1084   - "event manager",
1085   - "event system",
1086   - "events"
1087   - ],
1088   - "support": {
1089   - "issues": "https://github.com/doctrine/event-manager/issues",
1090   - "source": "https://github.com/doctrine/event-manager/tree/1.2.0"
1091   - },
1092   - "funding": [
1093   - {
1094   - "url": "https://www.doctrine-project.org/sponsorship.html",
1095   - "type": "custom"
1096   - },
1097   - {
1098   - "url": "https://www.patreon.com/phpdoctrine",
1099   - "type": "patreon"
1100   - },
1101   - {
1102   - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager",
1103   - "type": "tidelift"
1104   - }
1105   - ],
1106   - "time": "2022-10-12T20:51:15+00:00"
1107   - },
1108   - {
1109 915 "name": "doctrine/inflector",
1110 916 "version": "2.0.10",
1111 917 "source": {
... ... @@ -4893,6 +4699,55 @@
4893 4699 "time": "2022-11-25T14:36:26+00:00"
4894 4700 },
4895 4701 {
  4702 + "name": "psr/cache",
  4703 + "version": "3.0.0",
  4704 + "source": {
  4705 + "type": "git",
  4706 + "url": "https://github.com/php-fig/cache.git",
  4707 + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf"
  4708 + },
  4709 + "dist": {
  4710 + "type": "zip",
  4711 + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf",
  4712 + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf",
  4713 + "shasum": ""
  4714 + },
  4715 + "require": {
  4716 + "php": ">=8.0.0"
  4717 + },
  4718 + "type": "library",
  4719 + "extra": {
  4720 + "branch-alias": {
  4721 + "dev-master": "1.0.x-dev"
  4722 + }
  4723 + },
  4724 + "autoload": {
  4725 + "psr-4": {
  4726 + "Psr\\Cache\\": "src/"
  4727 + }
  4728 + },
  4729 + "notification-url": "https://packagist.org/downloads/",
  4730 + "license": [
  4731 + "MIT"
  4732 + ],
  4733 + "authors": [
  4734 + {
  4735 + "name": "PHP-FIG",
  4736 + "homepage": "https://www.php-fig.org/"
  4737 + }
  4738 + ],
  4739 + "description": "Common interface for caching libraries",
  4740 + "keywords": [
  4741 + "cache",
  4742 + "psr",
  4743 + "psr-6"
  4744 + ],
  4745 + "support": {
  4746 + "source": "https://github.com/php-fig/cache/tree/3.0.0"
  4747 + },
  4748 + "time": "2021-02-03T23:26:27+00:00"
  4749 + },
  4750 + {
4896 4751 "name": "psr/container",
4897 4752 "version": "2.0.2",
4898 4753 "source": {
... ... @@ -11090,5 +10945,5 @@
11090 10945 "php": "^8.0.2"
11091 10946 },
11092 10947 "platform-dev": [],
11093   - "plugin-api-version": "2.6.0"
  10948 + "plugin-api-version": "2.3.0"
11094 10949 }
database/migrations/2024_06_24_092718_alert_table_users.php
... ... @@ -13,12 +13,13 @@ return new class extends Migration
13 13 */
14 14 public function up()
15 15 {
16   - Schema::table('users', function (Blueprint $table) {
  16 + /* Schema::table('users', function (Blueprint $table) {
17 17 $table->smallInteger('is_lookin')->tinyInteger('is_lookin')->default(0)->change();
18 18 $table->smallInteger('is_message')->tinyInteger('is_message')->default(0)->change();
19 19 $table->smallInteger('is_public')->tinyInteger('is_public')->default(0)->change();
20 20 $table->smallInteger('is_manager')->tinyInteger('is_manager')->default(0)->change();
21 21 });
  22 + */
22 23 }
23 24  
24 25 /**
database/migrations/2024_06_27_124222_alert_sertifications_table.php
... ... @@ -14,7 +14,7 @@ return new class extends Migration
14 14 public function up()
15 15 {
16 16 Schema::table('sertifications', function (Blueprint $table) {
17   - $table->string('education', 255)->nullable()->change();
  17 + //$table->string('education', 255)->nullable()->change();
18 18 });
19 19 }
20 20  
database/migrations/2024_08_09_072423_alter_table_chats.php
... ... @@ -14,8 +14,8 @@ return new class extends Migration
14 14 public function up()
15 15 {
16 16 Schema::table('chats', function (Blueprint $table) {
17   - $table->dateTime('last_message_date')->nullable(true)->change();
18   - $table->integer('last_message_id')->nullable(true)->change();
  17 + $table->dateTime('last_message_date')->nullable(true); //->change();
  18 + $table->integer('last_message_id')->nullable(true); //->change();
19 19 $table->boolean('is_admin_chat')->default(false)->after('is_fixed');
20 20 });
21 21 }
database/migrations/2024_08_10_123217_alter_table_workers.php
... ... @@ -14,8 +14,9 @@ return new class extends Migration
14 14 public function up()
15 15 {
16 16 Schema::table('workers', function (Blueprint $table) {
  17 + $table->integer('position_work')->nullable(true);//->change();
17 18 $table->string('positions_work', 255)->nullable(true)->after('position_work');
18   - $table->integer('position_work')->nullable(true)->change();
  19 +
19 20  
20 21 });
21 22 }
database/migrations/2024_09_18_104034_change_ip_to_id_in_likes_tables.php
... ... @@ -13,12 +13,13 @@ return new class extends Migration
13 13 */
14 14 public function up()
15 15 {
16   - Schema::table('like_worker', function (Blueprint $table) {
  16 + /* Schema::table('like_worker', function (Blueprint $table) {
17 17 $table->renameColumn('ip_address', 'user_id');
18 18 });
19 19 Schema::table('like_vacancy', function (Blueprint $table) {
20 20 $table->renameColumn('ip_address', 'user_id');
21 21 });
  22 + */
22 23 }
23 24  
24 25 /**
database/migrations/2024_11_01_124040_create_worker_jobs_table.php
... ... @@ -0,0 +1,36 @@
  1 +<?php
  2 +
  3 +use Illuminate\Database\Migrations\Migration;
  4 +use Illuminate\Database\Schema\Blueprint;
  5 +use Illuminate\Support\Facades\Schema;
  6 +
  7 +return new class extends Migration
  8 +{
  9 + /**
  10 + * Run the migrations.
  11 + *
  12 + * @return void
  13 + */
  14 + public function up()
  15 + {
  16 +
  17 + /* Отказ от рефакторинга и нормализации табличных структур БД из-за сжатых сроков. Ларионов
  18 + Schema::create('worker_jobs', function (Blueprint $table) {
  19 + $table->id();
  20 + $table->bigInteger('user_id')->nullable(false);
  21 + $table->bigInteger('job_id')->nullable(false);
  22 + $table->timestamps();
  23 + });
  24 + */
  25 + }
  26 +
  27 + /**
  28 + * Reverse the migrations.
  29 + *
  30 + * @return void
  31 + */
  32 + public function down()
  33 + {
  34 + //Schema::dropIfExists('worker_jobs');
  35 + }
  36 +};
resources/views/admin/job_titles/form.blade.php
... ... @@ -25,6 +25,17 @@
25 25 </select>
26 26 </label><br>
27 27  
  28 + <? /*?>
  29 + <label class="block text-sm">
  30 + <span class="text-gray-700 dark:text-gray-400">Активность записи</span>
  31 + <select name="is_remove" class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-select focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
  32 + title="Активность">
  33 + <option value="0" @isset ($job_title) @if ($job_title->is_remove==0) selected @endif @endisset>Запись видимая</option>
  34 + <option value="1" @isset ($job_title) @if ($job_title->is_remove==1) selected @endif @endisset>Запись отключена</option>
  35 + </select>
  36 + </label><br>
  37 + <? */ ?>
  38 +
28 39 <label class="block text-sm">
29 40 <span class="text-gray-700 dark:text-gray-400">Категория должности</span>
30 41  
resources/views/employers/bd.blade.php
... ... @@ -161,14 +161,18 @@
161 161 @if ($users->count())
162 162 @foreach ($users as $key => $it)
163 163 <tr>
164   - <td style="max-width: 40px; min-width: 30px; font-size: 1.5rem">{{ $it->workers[0]->comment }}</td>
  164 + <td style="max-width: 40px; min-width: 30px; font-size: 1.5rem">@isset($it->workers[0]->comment){{ $it->workers[0]->comment }}@else @endisset</td>
165 165  
166 166 <td>{{ $it->surname." ".$it->name_man }}<br>{{ $it->surname2 }}</td>
167 167  
168 168 <td>
169   - @if($it->workers[0]->positions_work)
170   - {{ $it->workers[0]->jobs->first()->name }}
171   - @endif
  169 + @isset ($it->workers[0]->positions_work)
  170 + @if($it->workers[0]->positions_work)
  171 + {{ $it->workers[0]->jobs->first()->name }}
  172 + @endif
  173 + @else
  174 +
  175 + @endisset
172 176 </td>
173 177  
174 178 <td>