rkljw пре 2 месеци
родитељ
комит
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("添加失败");