Commit 5c177682aad8575f12e69ccde1d3b22fb809bdb6
1 parent
cbc8daa9
-Order history ready
Showing
1 changed file
with
42 additions
and
0 deletions
Show diff stats
views/statistics/index.php
| ... | ... | @@ -26,6 +26,11 @@ |
| 26 | 26 | * @var int | boolean $dataLabel |
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | + $js = <<< JS | |
| 30 | +$('[data-toggle="popover"]').popover(); | |
| 31 | +JS; | |
| 32 | +$this->registerJs($js, View::POS_READY); | |
| 33 | + | |
| 29 | 34 | ?> |
| 30 | 35 | |
| 31 | 36 | <div class="box box-default"> |
| ... | ... | @@ -325,6 +330,43 @@ |
| 325 | 330 | 'id', |
| 326 | 331 | 'created_at:datetime', |
| 327 | 332 | 'name', |
| 333 | + [ | |
| 334 | + 'label' => 'Товары', | |
| 335 | + 'content' => function(Order $model) { | |
| 336 | + if (empty($model->products)) { | |
| 337 | + return ''; | |
| 338 | + } else { | |
| 339 | + $content = ''; | |
| 340 | + $i = 0; | |
| 341 | + foreach ($model->products as $product) { | |
| 342 | + $i ++; | |
| 343 | + $content .= Html::a( | |
| 344 | + $product->sku, | |
| 345 | + '#', | |
| 346 | + [ | |
| 347 | + 'onclick' => 'event.preventDefault();', | |
| 348 | + 'data-toggle' => 'popover', | |
| 349 | + 'data-placement' => 'right', | |
| 350 | + 'data-html' => 'true', | |
| 351 | + 'data-content' => Html::img( | |
| 352 | + $product->productVariant->imageUrl, | |
| 353 | + [ | |
| 354 | + 'class' => 'img-rounded', | |
| 355 | + ] | |
| 356 | + ) . Html::tag('p', $product->product_name), | |
| 357 | + ] | |
| 358 | + ); | |
| 359 | + if ($i != count($model->products) ) { | |
| 360 | + $content .= ', '; | |
| 361 | + } | |
| 362 | + if ($i % 2 == 0) { | |
| 363 | + $content .= '<br>'; | |
| 364 | + } | |
| 365 | + } | |
| 366 | + return $content; | |
| 367 | + } | |
| 368 | + } | |
| 369 | + ], | |
| 328 | 370 | 'city', |
| 329 | 371 | [ |
| 330 | 372 | 'attribute' => 'orderLabel.label', | ... | ... |