registerJsFile('/admin/js/statistics.js', [ 'position' => View::POS_END, 'depends' => 'yii\web\JqueryAsset' ]); ?>

Поиск заказов

'date_range', 'value' => $dateValue, 'pluginOptions' => [ 'locale' => [ 'format' => 'DD-MM-Y', 'separator' => ' : ', ], ], ] ) ?>
'label', 'value' => $dataLabel, 'data' => ArrayHelper::map( $labels, function($model) { return $model->id; }, function($model) { return $model->lang->title; } ), 'options' => [ 'placeholder' => 'Все метки', ], 'pluginOptions' => [ 'allowClear' => true, ], ] ) ?>
'manager', 'value' => $dataManager, 'data' => ArrayHelper::map( $managers, function(User $model) { return $model->id; }, function(User $model) { return $model->username; } ), 'options' => [ 'placeholder' => 'Все менеджеры', ], 'pluginOptions' => [ 'allowClear' => true, ], ] ) ?>
'btn btn-success', ] ) ?>

Метки, статистика за

$statistic) { $total_count += $statistic[ 'count' ]; $total_sum += $statistic[ 'sum' ]; $total_products += $statistic[ 'products' ]; $total_unique += $statistic[ 'unique' ]; echo Html::tag( 'tr', Html::tag('td', $name) . Html::tag('td', $statistic[ 'count' ]) . Html::tag( 'td', $statistic[ 'sum' ] ) . Html::tag('td', $statistic[ 'products' ]) . Html::tag('td', $statistic[ 'unique' ]) ); } ?>
Метка Заказов, шт. На сумму, грн. Заказано товаров, шт. Уникальных товаров, шт.
Всего

Причины отказа, статистика за

$statistic) { echo Html::tag( 'tr', Html::tag('td', $name) . Html::tag('td', $statistic[ 'count' ]) . Html::tag( 'td', $statistic[ 'sum' ] ) ); } ?>
Причина Заказов, шт. На сумму, грн.

'glyphicon glyphicon-cog', ]) . ' Создать выгрузку', [ 'class' => 'btn bg-navy', 'id' => 'generate-button', 'data-link' => Url::to([ 'export', 'date_range' => $dateValue, 'label' => $dataLabel, 'manager' => $dataManager, ]) ]) ?>

Заказы

$dataProvider, 'columns' => [ 'id', [ 'label' => 'Дата добавления', 'content' => function(Order $model) { return \Yii::$app->formatter->asDate($model->created_at) . '
' . \Yii::$app->formatter->asTime($model->created_at); }, ], 'name', [ 'label' => 'Товары', 'content' => function(Order $model) { if (empty($model->products)) { return ''; } else { $content = ''; $i = 0; foreach ($model->products as $product) { if(empty($product->productVariant)){ $image = ''; } else { $image = $product->productVariant->imageUrl; } $i++; $content .= Html::a( $product->sku, '#', [ 'onclick' => 'event.preventDefault();', 'data-toggle' => 'popover', 'data-placement' => 'right', 'data-html' => 'true', 'data-content' => Html::img( $image, [ 'class' => 'img-rounded', ] ) . Html::tag('p', $product->product_name), ] ); if ($i != count($model->products)) { $content .= ', '; } if ($i % 2 == 0) { $content .= '
'; } } return $content; } }, ], 'city', [ 'attribute' => 'orderLabel.label', 'label' => 'Метка', ], 'total', [ 'attribute' => 'reason', 'content' => function($model) { /** * @var Order $model */ if (empty($model->reason)) { return ''; } else { return Order::REASONS[ $model->reason ]; } }, ], [ 'attribute' => 'manager.username', 'label' => 'Менеджер', ], [ 'attribute' => 'body', 'content' => function($model) { /** * @var Order $model */ if (empty($model->body)) { return ''; } else { return Html::a( StringHelper::truncate($model->body, 10, '...'), '#', [ 'data-toggle' => 'tooltip', 'title' => $model->body, 'onclick' => 'event.preventDefault();', ] ); } }, ], [ 'content' => function($model) { /** * @var Order $model */ return Html::a( Html::tag('i', '', [ 'class' => 'glyphicon glyphicon-eye-open' ]), [ '/ecommerce/order/view', 'id' => $model->id, ], [ 'target' => '_blank', 'data-pjax' => '0', ] ); }, ], ], ] ) ?>