Commit 622a985a5893cc28c20f60bb64b7357f05974f54
1 parent
b044365b
-Feed in process
-Orders table hover
Showing
3 changed files
with
11 additions
and
6 deletions
Show diff stats
controllers/OrderController.php
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | use Yii; | 9 | use Yii; |
| 10 | use yii\helpers\ArrayHelper; | 10 | use yii\helpers\ArrayHelper; |
| 11 | use yii\helpers\Json; | 11 | use yii\helpers\Json; |
| 12 | + use yii\helpers\VarDumper; | ||
| 12 | use yii\web\Controller; | 13 | use yii\web\Controller; |
| 13 | use yii\filters\VerbFilter; | 14 | use yii\filters\VerbFilter; |
| 14 | use yii\data\ActiveDataProvider; | 15 | use yii\data\ActiveDataProvider; |
| @@ -343,7 +344,7 @@ | @@ -343,7 +344,7 @@ | ||
| 343 | 344 | ||
| 344 | $headers = \Yii::$app->response->headers; | 345 | $headers = \Yii::$app->response->headers; |
| 345 | $headers->set('Access-Control-Allow-Origin', '*'); | 346 | $headers->set('Access-Control-Allow-Origin', '*'); |
| 346 | - | 347 | + |
| 347 | if ($model->load(Yii::$app->request->post()) && $model->save()) { | 348 | if ($model->load(Yii::$app->request->post()) && $model->save()) { |
| 348 | $this->unblockOrder($model->id); | 349 | $this->unblockOrder($model->id); |
| 349 | return $this->render( | 350 | return $this->render( |
models/Order.php
views/order/index.php
| @@ -181,6 +181,7 @@ JS; | @@ -181,6 +181,7 @@ JS; | ||
| 181 | <?php | 181 | <?php |
| 182 | echo GridView::widget( | 182 | echo GridView::widget( |
| 183 | [ | 183 | [ |
| 184 | + 'hover' => true, | ||
| 184 | 'dataProvider' => $dataProvider, | 185 | 'dataProvider' => $dataProvider, |
| 185 | 'filterModel' => $searchModel, | 186 | 'filterModel' => $searchModel, |
| 186 | 'rowOptions' => function($model) { | 187 | 'rowOptions' => function($model) { |
| @@ -206,7 +207,7 @@ JS; | @@ -206,7 +207,7 @@ JS; | ||
| 206 | ], | 207 | ], |
| 207 | [ | 208 | [ |
| 208 | 'attribute' => 'created_at', | 209 | 'attribute' => 'created_at', |
| 209 | - 'content' => function($model) { | 210 | + 'content' => function($model) { |
| 210 | return date('d/m/Y', $model->created_at) . '<br>' . date('G:i', $model->created_at); | 211 | return date('d/m/Y', $model->created_at) . '<br>' . date('G:i', $model->created_at); |
| 211 | }, | 212 | }, |
| 212 | 'filter' => $searchForm->field($searchModel, 'date_range') | 213 | 'filter' => $searchForm->field($searchModel, 'date_range') |
| @@ -232,8 +233,10 @@ JS; | @@ -232,8 +233,10 @@ JS; | ||
| 232 | if ($model->deadline == '') { | 233 | if ($model->deadline == '') { |
| 233 | return ''; | 234 | return ''; |
| 234 | } else { | 235 | } else { |
| 235 | - return \Yii::$app->formatter->asDate($model->deadline, 'php:d M') . '<br>' . | ||
| 236 | - \Yii::$app->formatter->asDate($model->deadline, 'php:Y г'); | 236 | + return \Yii::$app->formatter->asDate( |
| 237 | + $model->deadline, | ||
| 238 | + 'php:d M' | ||
| 239 | + ) . '<br>' . \Yii::$app->formatter->asDate($model->deadline, 'php:Y г'); | ||
| 237 | } | 240 | } |
| 238 | }, | 241 | }, |
| 239 | ], | 242 | ], |
| @@ -242,9 +245,9 @@ JS; | @@ -242,9 +245,9 @@ JS; | ||
| 242 | 'attribute' => 'total', | 245 | 'attribute' => 'total', |
| 243 | 'content' => function($model) { | 246 | 'content' => function($model) { |
| 244 | if (empty($model->total)) { | 247 | if (empty($model->total)) { |
| 245 | - return ''; | 248 | + return ''; |
| 246 | } else { | 249 | } else { |
| 247 | - return $model->total; | 250 | + return $model->total; |
| 248 | } | 251 | } |
| 249 | }, | 252 | }, |
| 250 | ], | 253 | ], |