From d8203a8c8c8cabe7f2a416d3e563688e64fc307a Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 18 Jan 2017 12:37:52 +0200 Subject: [PATCH] -Updated at bug fix --- models/Order.php | 3 +-- views/order/_log_item.php | 21 +++++++++------------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/models/Order.php b/models/Order.php index 67dcb13..1aae862 100755 --- a/models/Order.php +++ b/models/Order.php @@ -311,10 +311,9 @@ public function afterSave($insert, $changedAttributes) { -// VarDumper::dump($changedAttributes, 10, true);die(); $data = []; foreach ($changedAttributes as $key => $attribute) { - if ($this->oldAttributes[ $key ] != $attribute) { + if ($this->oldAttributes[ $key ] != $attribute && $key != 'updated_at') { $data[ $key ] = $this->getLogAttributes( $key, [ diff --git a/views/order/_log_item.php b/views/order/_log_item.php index 0c6f978..255a220 100644 --- a/views/order/_log_item.php +++ b/views/order/_log_item.php @@ -5,6 +5,7 @@ */ use artweb\artbox\ecommerce\models\Order; use artweb\artbox\ecommerce\models\OrderLog; + use yii\helpers\Html; use yii\helpers\Json; ?> @@ -16,7 +17,7 @@
formatter->asDatetime($model->created_at) ?> -

Пользователь: user->username?>

+

Пользователь: user->username ?>

@@ -27,17 +28,13 @@ data) as $key => $item) { - /** - * @todo refactor this continue - */ - if ($key == 'updated_at') continue; - ?> - - - - - - attributeLabels()[ $key ]) . Html::tag('td', $item[ 'old' ]) . Html::tag( + 'td', + $item[ 'new' ] + ) + ); } ?>
attributeLabels()[$key]?>
-- libgit2 0.21.4