Commit 3bb55546a01a9c31fb4eb2c69ceb47b58ebecc58
1 parent
b186d3bf
-Fixing bugs
Showing
2 changed files
with
13 additions
and
6 deletions
Show diff stats
models/Order.php
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | namespace artweb\artbox\ecommerce\models; | 2 | namespace artweb\artbox\ecommerce\models; |
| 3 | 3 | ||
| 4 | use artweb\artbox\models\Customer; | 4 | use artweb\artbox\models\Customer; |
| 5 | + use common\behaviors\DefaultLabelBehavior; | ||
| 5 | use common\models\User; | 6 | use common\models\User; |
| 6 | use Yii; | 7 | use Yii; |
| 7 | use yii\behaviors\TimestampBehavior; | 8 | use yii\behaviors\TimestampBehavior; |
| @@ -94,6 +95,9 @@ | @@ -94,6 +95,9 @@ | ||
| 94 | [ | 95 | [ |
| 95 | 'class' => TimestampBehavior::className(), | 96 | 'class' => TimestampBehavior::className(), |
| 96 | ], | 97 | ], |
| 98 | + [ | ||
| 99 | + 'class' => DefaultLabelBehavior::className(), | ||
| 100 | + ], | ||
| 97 | ]; | 101 | ]; |
| 98 | } | 102 | } |
| 99 | 103 | ||
| @@ -294,13 +298,12 @@ | @@ -294,13 +298,12 @@ | ||
| 294 | 298 | ||
| 295 | public function isBlocked() | 299 | public function isBlocked() |
| 296 | { | 300 | { |
| 297 | - if ($this->edit_id === 0 ) { | ||
| 298 | - return false; | 301 | + if ($this->edit_id === 0) { |
| 302 | + return false; | ||
| 299 | } else { | 303 | } else { |
| 300 | - if ( $this->edit_time + 7200 > time()) { | 304 | + if ($this->edit_time + 7200 > time()) { |
| 301 | return true; | 305 | return true; |
| 302 | - } | ||
| 303 | - else { | 306 | + } else { |
| 304 | return false; | 307 | return false; |
| 305 | } | 308 | } |
| 306 | } | 309 | } |
views/order/update.php
| @@ -25,7 +25,11 @@ $.ajax({ | @@ -25,7 +25,11 @@ $.ajax({ | ||
| 25 | id: ' . $model->id . ' | 25 | id: ' . $model->id . ' |
| 26 | }, | 26 | }, |
| 27 | success: function() { | 27 | success: function() { |
| 28 | - console.log("Ura"); | 28 | + $.notify({ |
| 29 | + message: \'Hello World\' | ||
| 30 | + },{ | ||
| 31 | + type: \'danger\' | ||
| 32 | + }); | ||
| 29 | } | 33 | } |
| 30 | });'; | 34 | });'; |
| 31 | 35 |