255], ['type', 'default', 'value' => 1,], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'store_id' => '商城id', 'pic_url' => '图片url', 'title' => '标题', 'page_url' => '页面路径', 'sort' => '排序,升序', 'addtime' => '添加时间', 'is_delete' => '是否删除:0=未删除,1=已删除', 'type' => '类型 【1=> 商城,2=> 拼团】', 'open_type' => 'Open Type', ]; } /** * @return array */ public function saveBanner() { if ($this->validate()) { if ($this->save()) { return [ 'code' => 0, 'msg' => '成功' ]; } else { return [ 'code' => 1, 'msg' => '失败' ]; } } else { return (new Model())->getErrorResponse($this); } } public function afterSave($insert, $changedAttributes) { $data = $insert ? json_encode($this->attributes) : json_encode($changedAttributes); CommonActionLog::storeActionLog('', $insert, $this->is_delete, $data, $this->id); } }