60], [['type'], 'default', 'value' => 0], [['is_delete'], 'default', 'value' => 0] ]; } /** * 保存分类 * @return array */ public function save() { if ($this->supplier_id > 0) { $this->store_id = 0; } $this->model->parent_id = $this->parent_id; $this->model->type = $this->type; $this->model->name = $this->name; $this->model->sort = $this->sort; $this->model->store_id = $this->store_id; $this->model->supplier_id = $this->supplier_id; if ($this->model->save()) { return [ 'code' => 0, 'msg' => '提交成功' ]; } else { return [ 'code' => 0, 'msg' => '保存失败' ]; } } }