diff --git a/views/statistics/index.php b/views/statistics/index.php index afbf6bc..32448f0 100644 --- a/views/statistics/index.php +++ b/views/statistics/index.php @@ -26,6 +26,11 @@ * @var int | boolean $dataLabel */ + $js = <<< JS +$('[data-toggle="popover"]').popover(); +JS; +$this->registerJs($js, View::POS_READY); + ?>
@@ -325,6 +330,43 @@ 'id', 'created_at:datetime', 'name', + [ + 'label' => 'Товары', + 'content' => function(Order $model) { + if (empty($model->products)) { + return ''; + } else { + $content = ''; + $i = 0; + foreach ($model->products as $product) { + $i ++; + $content .= Html::a( + $product->sku, + '#', + [ + 'onclick' => 'event.preventDefault();', + 'data-toggle' => 'popover', + 'data-placement' => 'right', + 'data-html' => 'true', + 'data-content' => Html::img( + $product->productVariant->imageUrl, + [ + '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', -- libgit2 0.21.4