service = CatalogueService::getInstance(); $this->insertField = ['title', 'category_id', 'cover', 'identifier']; $this->updateField = ['id', 'title', 'category_id', 'cover', 'identifier']; $this->notRequest = ['alias', 'pdf', 'price', 'status']; } /** * 启用 / 禁用 * @Method POST * @throws Exception */ public function status(): JsonResponse { $this->insertField = ['id', 'status']; $params = $this->checkRequiredFields(request()->post()); return jok($this->service->status($params['id'], $params['status']), '操作成功'); } }