Commit deaedeb05cfabfd2f4df39b677b3e9c567b6088f
1 parent
1a954235
-Order module task #2
Showing
3 changed files
with
25 additions
and
5 deletions
Show diff stats
models/OrderSearch.php
views/order/index.php
... | ... | @@ -262,7 +262,6 @@ JS; |
262 | 262 | } |
263 | 263 | }, |
264 | 264 | ], |
265 | - | |
266 | 265 | [ |
267 | 266 | 'attribute' => 'body', |
268 | 267 | 'content' => function($model) { |
... | ... | @@ -273,7 +272,20 @@ JS; |
273 | 272 | } |
274 | 273 | }, |
275 | 274 | ], |
276 | - 'sms', | |
275 | + [ | |
276 | + 'attribute' => 'sms', | |
277 | + 'content' => function($model) { | |
278 | + if (!empty( $model->sms )) { | |
279 | + return Html::a(StringHelper::truncate($model->sms, 12, '...'), '#', [ | |
280 | + 'data-toggle' => 'tooltip', | |
281 | + 'title' => $model->sms, | |
282 | + 'onclick' => 'event.preventDefault();', | |
283 | + ]); | |
284 | + } else { | |
285 | + return ''; | |
286 | + } | |
287 | + }, | |
288 | + ], | |
277 | 289 | [ |
278 | 290 | 'class' => 'yii\grid\ActionColumn', |
279 | 291 | 'template' => \Yii::$app->user->identity->isAdmin( | ... | ... |
views/order/update.php
... | ... | @@ -36,7 +36,7 @@ $.ajax({ |
36 | 36 | }); |
37 | 37 | } |
38 | 38 | });'; |
39 | - | |
39 | + | |
40 | 40 | $this->registerJs($js, View::POS_READY); |
41 | 41 | |
42 | 42 | $js = ' |
... | ... | @@ -55,10 +55,15 @@ $.ajax({ |
55 | 55 | '; |
56 | 56 | |
57 | 57 | $this->registerJs($js, View::POS_READY); |
58 | - | |
58 | + | |
59 | 59 | ?> |
60 | 60 | <div class="order-update"> |
61 | - <div class="container"><h1><?php echo Html::encode($this->title) ?></h1></div> | |
61 | + <div class="container"> | |
62 | + <h1><?php echo Html::encode($this->title) ?> | <?php echo date( | |
63 | + 'd-m-Y G:i', | |
64 | + $model->created_at | |
65 | + ); ?> | <?php echo $model->manager->username; ?></h1> | |
66 | + </div> | |
62 | 67 | |
63 | 68 | <?= $this->render( |
64 | 69 | '_form', | ... | ... |