Commit 748f122fa7bf40cd5e9809a09b5f70d1bc3e7d17
1 parent
f364ad5b7a
Exists in
master
and in
1 other branch
Коммит по документам в инфоблоке
Showing 3 changed files with 14 additions and 1 deletions Side-by-side Diff
app/Models/Ad_employer.php
app/Models/infobloks.php
... | ... | @@ -18,4 +18,12 @@ class infobloks extends Model |
18 | 18 | public function ScopeActive($query) { |
19 | 19 | return $query->where('is_remove', '=', '0'); |
20 | 20 | } |
21 | + | |
22 | + /* | |
23 | + * Связь модели Инфоблоки (Infobloks) с моделью Доп.информация (dop_info) | |
24 | + один-ко-многим | |
25 | + */ | |
26 | + public function model_dop_info() { | |
27 | + return $this->hasMany(dop_info::class, 'infoblok_id'); | |
28 | + } | |
21 | 29 | } |
resources/views/worker.blade.php
... | ... | @@ -235,6 +235,12 @@ |
235 | 235 | <tr> |
236 | 236 | <td>Документ:</td> |
237 | 237 | <td><b>{{ $it->name }}</b></td> |
238 | + <td> | |
239 | + @if ($it->model_dop_info[0]->status == 0) Не указано | |
240 | + @elseif($it->model_dop_info[0]->status==1) В наличии | |
241 | + @else Отсутствует | |
242 | + @endif | |
243 | + </td> | |
238 | 244 | </tr> |
239 | 245 | @endforeach |
240 | 246 | </tbody> |