Commit 23eadb7ed83dc857595ea54816db90ba7b8964e3

Authored by Андрей Ларионов
1 parent df6f35bf3b
Exists in master

Коммит пятницы

Showing 6 changed files with 101 additions and 15 deletions Side-by-side Diff

app/Http/Controllers/MainController.php
... ... @@ -264,7 +264,7 @@ class MainController extends Controller
264 264 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
265 265 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
266 266 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
267   - default: $Query = $Query->orderBy('id')->orderby('updated_at'); break;
  267 + default: $Query = $Query->orderbyDesc('updated_at')->orderBy('id'); break;
268 268 }
269 269 }
270 270  
... ... @@ -272,7 +272,7 @@ class MainController extends Controller
272 272  
273 273 $Query_count = $Query->count();
274 274  
275   - $Query = $Query->OrderBy('updated_at')->paginate(3);
  275 + $Query = $Query->OrderByDesc('updated_at')->paginate(3);
276 276  
277 277 $Reclama = reclame::query()->get();
278 278  
app/Http/Controllers/WorkerController.php
... ... @@ -171,6 +171,7 @@ class WorkerController extends Controller
171 171 $Query = $Query->get();
172 172  
173 173 $get_date = date('Y.m');
  174 +
174 175 $c = Static_worker::query()->where('year_month', '=', $get_date)
175 176 ->where('user_id', '=', $worker->user_id)
176 177 ->get();
... ... @@ -252,9 +253,10 @@ class WorkerController extends Controller
252 253 $Infoblocks = infobloks::query()->OrderBy('name')->get();
253 254  
254 255 $stat = Static_worker::query()->where('year_month', '=', $get_date)
255   - ->where('user_id', '=', $Worker[0]->id)
  256 + ->where('user_id', '=', $id)
256 257 ->get();
257 258  
  259 +
258 260 // 10%
259 261  
260 262 $persent = 10;
... ... @@ -715,6 +717,12 @@ class WorkerController extends Controller
715 717 $ad_employer = 0;
716 718 }
717 719  
  720 + if (isset($user1->id)) {
  721 + $sender = User_Model::query()->with('workers')->
  722 + with('employers')->
  723 + where('id', $user1->id)->first();
  724 + }
  725 +
718 726 if (isset($user2->id)) {
719 727 $companion = User_Model::query()->with('workers')->
720 728 with('employers')->
... ... @@ -744,8 +752,6 @@ class WorkerController extends Controller
744 752  
745 753 //$ad_employer = null;
746 754 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
747   - $sender = $user1;
748   -
749 755  
750 756 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer'));
751 757 }
resources/views/employers/dialog.blade.php
... ... @@ -83,7 +83,12 @@
83 83 <svg>
84 84 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
85 85 </svg>
86   - <img src="{{ asset('images/default_man.jpg') }}" alt="">
  86 + @if ((isset($companion->workers[0]->photo)) &&
  87 + (!empty($companion->workers[0]->photo)))
  88 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt="">
  89 + @else
  90 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  91 + @endif
87 92 </div>
88 93 <div class="messages__item-text">
89 94 <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div>
... ... @@ -112,7 +117,12 @@
112 117 <svg>
113 118 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
114 119 </svg>
115   - <img src="{{ asset('images/default_man.jpg') }}" alt="">
  120 + @if ((isset($companion->employers[0]->logo)) &&
  121 + (!empty($companion->employers[0]->logo)))
  122 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt="">
  123 + @else
  124 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  125 + @endif
116 126 </div>
117 127 <div class="messages__item-text">
118 128 <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div>
... ... @@ -139,7 +149,23 @@
139 149 <svg>
140 150 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
141 151 </svg>
142   - <img src="{{ asset('images/default_man.jpg') }}" alt="">
  152 +
  153 + @if ($companion->is_worker)
  154 + @if ((isset($companion->workers[0]->photo)) &&
  155 + (!empty($companion->workers[0]->photo)))
  156 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt="">
  157 + @else
  158 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  159 + @endif
  160 + @else
  161 + @if ((isset($companion->employers[0]->logo)) &&
  162 + (!empty($companion->employers[0]->logo)))
  163 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt="">
  164 + @else
  165 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  166 + @endif
  167 + @endif
  168 +
143 169 </div>
144 170 <div class="chatbox__item-body">
145 171 <div class="chatbox__item-text">{{ $it->text }}</div>
... ... @@ -152,7 +178,23 @@
152 178 <svg>
153 179 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
154 180 </svg>
155   - <img src="{{ asset('images/default_man.jpg') }}" alt="">
  181 +
  182 + @if ($sender->is_worker)
  183 + @if ((isset($sender->workers[0]->photo)) &&
  184 + (!empty($sender->workers[0]->photo)))
  185 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->workers[0]->photo)) }}" alt="">
  186 + @else
  187 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  188 + @endif
  189 + @else
  190 + @if ((isset($sender->employers[0]->logo)) &&
  191 + (!empty($sender->employers[0]->logo)))
  192 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->employers[0]->logo)) }}" alt="">
  193 + @else
  194 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  195 + @endif
  196 + @endif
  197 +
156 198 </div>
157 199 <div class="chatbox__item-body">
158 200 <div class="chatbox__item-text">{{ $it->text }}</div>
resources/views/info_company_new.blade.php
... ... @@ -106,7 +106,7 @@
106 106 @endif
107 107  
108 108 <h1 class="thing__title">{{ $company[0]->name_company }}</h1>
109   - <p class="thing__text">{!! $company[0]->text !!}</p>
  109 + <!--<p class="thing__text"> $company[0]->text !!}</p>-->
110 110 <div class="thing__buttons">
111 111 <button type="button" class="button">
112 112 <svg>
resources/views/worker.blade.php
... ... @@ -233,7 +233,6 @@
233 233 <tbody>
234 234 @foreach($Query[0]->infobloks as $it)
235 235 <tr>
236   - <td>Документ:</td>
237 236 <td><b>{{ $it->name }}</b></td>
238 237 <td>
239 238 @if ($it->model_dop_info[0]->status == 0) Не указано
resources/views/workers/dialog.blade.php
... ... @@ -83,7 +83,12 @@
83 83 <svg>
84 84 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
85 85 </svg>
86   - <img src="{{ asset('images/default_man.jpg') }}" alt="">
  86 + @if ((isset($companion->workers[0]->photo)) &&
  87 + (!empty($companion->workers[0]->photo)))
  88 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt="">
  89 + @else
  90 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  91 + @endif
87 92 </div>
88 93 <div class="messages__item-text">
89 94 <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div>
... ... @@ -104,7 +109,12 @@
104 109 <svg>
105 110 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
106 111 </svg>
107   - <img src="{{ asset('images/default_man.jpg') }}" alt="">
  112 + @if ((isset($companion->employers[0]->logo)) &&
  113 + (!empty($companion->employers[0]->logo)))
  114 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt="">
  115 + @else
  116 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  117 + @endif
108 118 </div>
109 119 <div class="messages__item-text">
110 120 <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div>
... ... @@ -131,7 +141,21 @@
131 141 <svg>
132 142 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
133 143 </svg>
134   - <img src="{{ asset('images/default_man.jpg') }}" alt="">
  144 + @if ($companion->is_worker)
  145 + @if ((isset($companion->workers[0]->photo)) &&
  146 + (!empty($companion->workers[0]->photo)))
  147 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt="">
  148 + @else
  149 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  150 + @endif
  151 + @else
  152 + @if ((isset($companion->employers[0]->logo)) &&
  153 + (!empty($companion->employers[0]->logo)))
  154 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt="">
  155 + @else
  156 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  157 + @endif
  158 + @endif
135 159 </div>
136 160 <div class="chatbox__item-body">
137 161 <div class="chatbox__item-text">{{ $it->text }}</div>
... ... @@ -144,7 +168,22 @@
144 168 <svg>
145 169 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
146 170 </svg>
147   - <img src="{{ asset('images/default_man.jpg') }}" alt="">
  171 + @if ($sender->is_worker)
  172 + @if ((isset($sender->workers[0]->photo)) &&
  173 + (!empty($sender->workers[0]->photo)))
  174 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->workers[0]->photo)) }}" alt="">
  175 + @else
  176 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  177 + @endif
  178 + @else
  179 + @if ((isset($sender->employers[0]->logo)) &&
  180 + (!empty($sender->employers[0]->logo)))
  181 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->employers[0]->logo)) }}" alt="">
  182 + @else
  183 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  184 + @endif
  185 + @endif
  186 +
148 187 </div>
149 188 <div class="chatbox__item-body">
150 189 <div class="chatbox__item-text">{{ $it->text }}</div>