<th>Количество</th>
</tr>
<?php
+ $item->setComponentsArray();
if (!empty($item->componentsArray)) {
$components = $item->componentsArray;
foreach ($components as $component) {
-
-
?>
<tr>
<td><?=$component['name'] ?? ''?></td>
if (!empty($imagesArray)) {
$images = implode('', $imagesArray);
}
-
-
-
?>
<td><?=$images ?? ''?></td>
<td class="description"><?=$matrixProperty->description ?? ''?></td>
<div class="tab-pane" id="tab<?= $num_row ?>3">
<table class="table detail-transaction">
<tbody>
- <tr>
- <th>Название</th>
- <th>Ссылка</th>
- </tr>
- <?php
- if (!empty($matrixProperty->url_link_video)) {
- ?>
<tr>
- <td>Ссылка на видео</td>
- <td><?= Html::a(
- $matrixProperty->url_link_video,
- $matrixProperty->url_link_video,
- [
- 'class' => 'profile-link',
- 'target'=>'_blank'
- ]
- );?>
- </td>
+ <th>Название</th>
+ <th>Ссылка</th>
</tr>
- <?php
- }
- if (!empty($matrixMediaRow)) {
- foreach ($matrixMediaRow as $matrixErpMediaRow) {
-
- $filesList = [];
- $fileRow = null;
- /** @var \yii_app\records\MatrixErpMedia $matrixErpMediaRow */
- $filesQuery = $matrixErpMediaRow->getFiles();
- $filesRow = $filesQuery->one();
- // foreach($MatrixErpMedia as $matrixErpMediaRow) {
- //$filesRow = ArrayHelper::getValue($matrixErpMediaRow->getRelatedRecords(),'files');
- if (!empty($filesRow)) {
- $fileRow = FileService::getFile($filesRow);
- }
-
- ?>
+ <?php if (!empty($matrixProperty->url_link_video)): ?>
<tr>
-
- <td> <?= $matrixErpMediaRow->name?> </td>
- <td> <?= $fileRow ?? ''?> </td>
+ <td>Ссылка на видео</td>
+ <td><?= Html::a(
+ $matrixProperty->url_link_video,
+ $matrixProperty->url_link_video,
+ [
+ 'class' => 'profile-link',
+ 'target'=>'_blank'
+ ]
+ );?>
+ </td>
</tr>
- <?php
- }
- }
- ?>
-
+ <?php endif; ?>
+ <?php if (!empty($matrixMediaRow)): ?>
+ <?php foreach ($matrixMediaRow as $matrixErpMediaRow):
+ /** @var \yii_app\records\MatrixErpMedia $matrixErpMediaRow */?>
+ <tr>
+ <td> <?= $matrixErpMediaRow->name?> </td>
+ <td> <?= $matrixErpMediaRow->file ?
+ (FileService::getFile($matrixErpMediaRow->file) ?? '') : '' ?> </td>
+ </tr>
+ <?php endforeach; ?>
+ <?php endif; ?>
</tbody>
</table>
</div>