<?php
+use yii\helpers\ArrayHelper;
use yii_app\records\MarketplaceOrder1cStatuses;
use yii\helpers\Html;
use yii\helpers\Url;
'format' => 'raw',
'value' => function (MarketplaceOrder1cStatuses $model) {
$links = [];
+ $relations = ArrayHelper::toArray($model->relationsFrom);
+ $relationsMap = ArrayHelper::index($relations, 'status_id_from');
foreach ($model->nextStatuses as $nextStatus) {
- $links[$nextStatus->order] = Html::a(
+ $order = (int)$relationsMap[$nextStatus->id]['order'];
+ $links[$order] = Html::a(
Html::encode($nextStatus->status),
['/crud/marketplace-order-1c-statuses/view', 'id' => $nextStatus->id]
);
<?php
+use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii_app\records\MarketplaceOrder1cStatuses;
'format' => 'raw',
'value' => function (MarketplaceOrder1cStatuses $model) {
$links = [];
+ $relations = ArrayHelper::toArray($model->relationsFrom);
+ $relationsMap = ArrayHelper::index($relations, 'status_id_from');
foreach ($model->nextStatuses as $nextStatus) {
- $links[$nextStatus->order] = Html::a(
+ $order = (int)$relationsMap[$nextStatus->id]['order'];
+ $links[$order] = Html::a(
Html::encode($nextStatus->status),
['/crud/marketplace-order-1c-statuses/view', 'id' => $nextStatus->id]
);