From 9e2bb06fd8ae4a304b0d69428da81001bc6155e0 Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Thu, 12 Dec 2019 14:51:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=89=8D=E7=AB=AF=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E6=A8=A1=E5=9E=8B=E5=A2=9E=E5=8A=A0beforesav?= =?UTF-8?q?e=E6=96=B9=E6=B3=95=EF=BC=8C=E5=9C=A8beforesave=E4=B8=AD?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0filter=5Fattr=E5=AD=97=E6=AE=B5=E7=9A=84?= =?UTF-8?q?=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/modules/goods/models/ars/ShopCategory.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/modules/goods/models/ars/ShopCategory.php b/backend/modules/goods/models/ars/ShopCategory.php index 2d3c7d3..3ec719c 100755 --- a/backend/modules/goods/models/ars/ShopCategory.php +++ b/backend/modules/goods/models/ars/ShopCategory.php @@ -120,4 +120,12 @@ class ShopCategory extends \yii\db\ActiveRecord { return $this->hasOne(File::className(), ['id' => 'icon']); } + + public function beforeSave($insert) + { + if ($this->filter_attr != null && is_array($this->filter_attr)) { + $this->filter_attr = implode(',', $this->filter_attr); + } + return parent::beforeSave($insert); // TODO: Change the autogenerated stub + } }