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() {