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 | 9 | use Yii; |
10 | 10 | use yii\helpers\ArrayHelper; |
11 | 11 | use yii\helpers\Json; |
12 | + use yii\helpers\VarDumper; | |
12 | 13 | use yii\web\Controller; |
13 | 14 | use yii\filters\VerbFilter; |
14 | 15 | use yii\data\ActiveDataProvider; |
... | ... | @@ -343,7 +344,7 @@ |
343 | 344 | |
344 | 345 | $headers = \Yii::$app->response->headers; |
345 | 346 | $headers->set('Access-Control-Allow-Origin', '*'); |
346 | - | |
347 | + | |
347 | 348 | if ($model->load(Yii::$app->request->post()) && $model->save()) { |
348 | 349 | $this->unblockOrder($model->id); |
349 | 350 | return $this->render( | ... | ... |
models/Order.php
views/order/index.php
... | ... | @@ -181,6 +181,7 @@ JS; |
181 | 181 | <?php |
182 | 182 | echo GridView::widget( |
183 | 183 | [ |
184 | + 'hover' => true, | |
184 | 185 | 'dataProvider' => $dataProvider, |
185 | 186 | 'filterModel' => $searchModel, |
186 | 187 | 'rowOptions' => function($model) { |
... | ... | @@ -206,7 +207,7 @@ JS; |
206 | 207 | ], |
207 | 208 | [ |
208 | 209 | 'attribute' => 'created_at', |
209 | - 'content' => function($model) { | |
210 | + 'content' => function($model) { | |
210 | 211 | return date('d/m/Y', $model->created_at) . '<br>' . date('G:i', $model->created_at); |
211 | 212 | }, |
212 | 213 | 'filter' => $searchForm->field($searchModel, 'date_range') |
... | ... | @@ -232,8 +233,10 @@ JS; |
232 | 233 | if ($model->deadline == '') { |
233 | 234 | return ''; |
234 | 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 | 245 | 'attribute' => 'total', |
243 | 246 | 'content' => function($model) { |
244 | 247 | if (empty($model->total)) { |
245 | - return ''; | |
248 | + return ''; | |
246 | 249 | } else { |
247 | - return $model->total; | |
250 | + return $model->total; | |
248 | 251 | } |
249 | 252 | }, |
250 | 253 | ], | ... | ... |