Explorar el Código

修改栏目排序

rkljw hace 1 mes
padre
commit
4e2a399eb7
Se han modificado 2 ficheros con 26 adiciones y 0 borrados
  1. 19 0
      app/JsonRpc/WebsiteService.php
  2. 7 0
      app/JsonRpc/WebsiteServiceInterface.php

+ 19 - 0
app/JsonRpc/WebsiteService.php

@@ -1661,4 +1661,23 @@ class WebsiteService implements WebsiteServiceInterface
         }
     }
 
+    /**
+     * 修改网站栏目排序
+     * @param array $data
+     * @return array
+     */
+    public function upWebsiteCategorySort(array $data): array
+    {
+        $where = [
+            'website_id' => $data['website_id'],
+            'id' => $data['id'],
+        ];
+        $result = WebsiteCategory::where($where)->update($data);
+        if ($result) {
+            return Result::success($result);
+        } else {
+            return Result::error("更新失败", 0);
+        }
+    }
+
 }

+ 7 - 0
app/JsonRpc/WebsiteServiceInterface.php

@@ -105,4 +105,11 @@ interface WebsiteServiceInterface
      * @return array
      */
     public function getAllCategory(array $data): array;
+
+    /**
+     * 修改网站栏目排序
+     * @param array $data
+     * @return array
+     */
+    public function upWebsiteCategorySort(array $data): array;
 }