rkljw 1 月之前
父節點
當前提交
79c7b02730
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      app/JsonRpc/NewsService.php

+ 3 - 0
app/JsonRpc/NewsService.php

@@ -114,6 +114,9 @@ class NewsService implements NewsServiceInterface
      */
     public function addCategory(array $data): array
     {
+        if(isset($data['id'])){
+            unset($data['id']);
+        }
         $id = Category::insertGetId($data);
         if (empty($id)) {
             return Result::error("添加失败");