pull/1/head
wanghousheng 10 months ago
parent 47943138c4
commit 1363d75d75
  1. 12
      app/api/controller/Article.php
  2. 6
      app/store/controller/Invite.php

@ -171,9 +171,9 @@ class Article extends Controller
return $this->renderError('名称不能为空'); return $this->renderError('名称不能为空');
} }
$img_id = intval($this->request->post('img_id')); $img_id = intval($this->request->post('img_id'));
if (!$img_id) { // if (!$img_id) {
return $this->renderError('图片不能为空'); // return $this->renderError('图片不能为空');
} // }
$status = intval($this->request->post('status', 1)); $status = intval($this->request->post('status', 1));
$sort = intval($this->request->post('sort', 100)); $sort = intval($this->request->post('sort', 100));
$data = compact('status', 'sort', 'name', 'img_id'); $data = compact('status', 'sort', 'name', 'img_id');
@ -203,9 +203,9 @@ class Article extends Controller
return $this->renderError('名称不能为空'); return $this->renderError('名称不能为空');
} }
$img_id = intval($this->request->post('img_id')); $img_id = intval($this->request->post('img_id'));
if (!$img_id) { // if (!$img_id) {
return $this->renderError('图片不能为空'); // return $this->renderError('图片不能为空');
} // }
$status = intval($this->request->post('status', 1)); $status = intval($this->request->post('status', 1));
$sort = intval($this->request->post('sort', 100)); $sort = intval($this->request->post('sort', 100));
$data = compact('status', 'sort', 'name', 'img_id'); $data = compact('status', 'sort', 'name', 'img_id');

@ -18,15 +18,13 @@ class Invite extends Controller
return $this->renderSuccess(compact('info')); return $this->renderSuccess(compact('info'));
} }
public function editConfig() public function editConfig(int $configId): Json
{ {
$id =
$info = InviteConfig::detail();
$data = $this->postForm(); $data = $this->postForm();
if (!$data) { if (!$data) {
return $this->renderError('缺少必要参数'); return $this->renderError('缺少必要参数');
} }
$model = ServerCategory::detail($categoryId); $model = InviteConfig::detail($configId);
if ($model->edit($data)) { if ($model->edit($data)) {
return $this->renderSuccess('编辑成功'); return $this->renderSuccess('编辑成功');
} }

Loading…
Cancel
Save