255], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'store_id' => 'Store ID', 'name' => '卡券名称', 'pic_url' => '卡券图片', 'content' => '卡券描述', 'is_delete' => 'Is Delete', 'addtime' => 'Addtime', ]; } public function beforeSave($insert) { $this->name = \yii\helpers\Html::encode($this->name); $this->content = \yii\helpers\Html::encode($this->content); return parent::beforeSave($insert); } public function afterSave($insert, $changedAttributes) { $data = $insert ? json_encode($this->attributes) : json_encode($changedAttributes); $title = '卡券'; CommonActionLog::storeActionLog($title, $insert, $this->is_delete, $data, $this->id); } }