Commit a1da4203127e9b58f54a29016e81e1587e4f9559

Authored by Alexey Boroda
1 parent 1228053e

-Date fixed

Showing 1 changed file with 16 additions and 3 deletions   Show diff stats
views/order/index.php
1 <?php 1 <?php
2 2
  3 + use artbox\order\models\Order;
3 use yii\helpers\Html; 4 use yii\helpers\Html;
4 use yii\grid\GridView; 5 use yii\grid\GridView;
5 use yiister\gentelella\widgets\Panel; 6 use yiister\gentelella\widgets\Panel;
@@ -32,7 +33,7 @@ @@ -32,7 +33,7 @@
32 'filterModel' => $searchModel, 33 'filterModel' => $searchModel,
33 'columns' => [ 34 'columns' => [
34 [ 'class' => 'yii\grid\SerialColumn' ], 35 [ 'class' => 'yii\grid\SerialColumn' ],
35 - 36 +
36 'id', 37 'id',
37 'user_id', 38 'user_id',
38 'name', 39 'name',
@@ -43,7 +44,19 @@ @@ -43,7 +44,19 @@
43 'value' => 'label.lang.title', 44 'value' => 'label.lang.title',
44 'filter' => $labels, 45 'filter' => $labels,
45 ], 46 ],
46 - 'created_at:datetime', 47 + [
  48 + 'attribute' => 'created_at',
  49 + 'value' => function ($model) {
  50 + /**
  51 + * @var Order $model
  52 + */
  53 + if (empty($model->created_at)) {
  54 + return \Yii::$app->formatter->asText('');
  55 + } else {
  56 + return date('d M, Y H:i:s', $model->created_at);
  57 + }
  58 + },
  59 + ],
47 [ 60 [
48 'attribute' => 'count', 61 'attribute' => 'count',
49 'value' => function ($model) { 62 'value' => function ($model) {
@@ -53,7 +66,7 @@ @@ -53,7 +66,7 @@
53 return count($model->orderProducts); 66 return count($model->orderProducts);
54 }, 67 },
55 ], 68 ],
56 - 69 +
57 [ 'class' => 'yii\grid\ActionColumn', 70 [ 'class' => 'yii\grid\ActionColumn',
58 'template' => '{view} {update} {delete} {print}', 71 'template' => '{view} {update} {delete} {print}',
59 'buttons' => [ 72 'buttons' => [