From e4c8dfa757d5a55aa4f9054c1753fb177cc3ef93 Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Tue, 10 Dec 2019 19:38:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E8=8C=83=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/modules/file/models/ars/File.php | 6 +++--- backend/modules/goods/logic/goods/GoodsManager.php | 2 +- backend/modules/goods/models/ars/Category.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/modules/file/models/ars/File.php b/backend/modules/file/models/ars/File.php index e2785f0..0e03088 100755 --- a/backend/modules/file/models/ars/File.php +++ b/backend/modules/file/models/ars/File.php @@ -2,8 +2,8 @@ namespace backend\modules\file\models\ars; -use Yii; use yii\behaviors\TimestampBehavior; +use yii\db\ActiveRecord; /** * This is the model class for table "ats_file". @@ -20,7 +20,7 @@ use yii\behaviors\TimestampBehavior; * @property int $updated_at 更新时间 * @property int $created_at 创建时间 */ -class File extends \yii\db\ActiveRecord +class File extends ActiveRecord { //own_type const OWN_TYPE_GOODS_INDEX = 1;//商品首页 @@ -81,7 +81,7 @@ class File extends \yii\db\ActiveRecord { return [ [ - 'class' => TimestampBehavior::className(), + 'class' => TimestampBehavior::class, 'createdAtAttribute' => 'created_at', 'updatedAtAttribute' => 'updated_at', 'value' => function() { diff --git a/backend/modules/goods/logic/goods/GoodsManager.php b/backend/modules/goods/logic/goods/GoodsManager.php index ea4d990..1eb735b 100755 --- a/backend/modules/goods/logic/goods/GoodsManager.php +++ b/backend/modules/goods/logic/goods/GoodsManager.php @@ -81,7 +81,7 @@ class GoodsManager if (!$model->save()) { throw new \Exception('商品保存失败'); } - $saveCoverImageRes = self::saveFile(explode(',', $model->coverImageId), $model, explode(',', $coverImageOldIdStr)); + $saveCoverImageRes = self::saveFile(explode(',', $model->coverImageId), $model, explode(',', $coverImageOldIdStr), File::OWN_TYPE_GOODS_INDEX); $saveDetailImageRes = self::saveFile(explode(',', $model->detailImageId), $model, explode(',', $detailImageOldIdStr), File::OWN_TYPE_GOODS_DETAILS); if($saveCoverImageRes['first_file_id'] !== 0) { $model->image = $saveCoverImageRes['first_file_id']; diff --git a/backend/modules/goods/models/ars/Category.php b/backend/modules/goods/models/ars/Category.php index 827ec36..1f013d1 100755 --- a/backend/modules/goods/models/ars/Category.php +++ b/backend/modules/goods/models/ars/Category.php @@ -88,7 +88,7 @@ class Category extends \yii\db\ActiveRecord { return [ [ - 'class' => TimestampBehavior::className(), + 'class' => TimestampBehavior::class, 'createdAtAttribute' => 'created_at', 'updatedAtAttribute' => 'updated_at', 'value' => function() {