diff --git a/app/api/controller/Article.php b/app/api/controller/Article.php index eded1201..0c8fc9ab 100644 --- a/app/api/controller/Article.php +++ b/app/api/controller/Article.php @@ -171,9 +171,9 @@ class Article extends Controller return $this->renderError('名称不能为空'); } $img_id = intval($this->request->post('img_id')); - if (!$img_id) { - return $this->renderError('图片不能为空'); - } +// if (!$img_id) { +// return $this->renderError('图片不能为空'); +// } $status = intval($this->request->post('status', 1)); $sort = intval($this->request->post('sort', 100)); $data = compact('status', 'sort', 'name', 'img_id'); @@ -203,9 +203,9 @@ class Article extends Controller return $this->renderError('名称不能为空'); } $img_id = intval($this->request->post('img_id')); - if (!$img_id) { - return $this->renderError('图片不能为空'); - } +// if (!$img_id) { +// return $this->renderError('图片不能为空'); +// } $status = intval($this->request->post('status', 1)); $sort = intval($this->request->post('sort', 100)); $data = compact('status', 'sort', 'name', 'img_id'); diff --git a/app/store/controller/Invite.php b/app/store/controller/Invite.php index 47b3257c..2c45cefa 100644 --- a/app/store/controller/Invite.php +++ b/app/store/controller/Invite.php @@ -18,15 +18,13 @@ class Invite extends Controller return $this->renderSuccess(compact('info')); } - public function editConfig() + public function editConfig(int $configId): Json { - $id = - $info = InviteConfig::detail(); $data = $this->postForm(); if (!$data) { return $this->renderError('缺少必要参数'); } - $model = ServerCategory::detail($categoryId); + $model = InviteConfig::detail($configId); if ($model->edit($data)) { return $this->renderSuccess('编辑成功'); }