rkljw 5 days ago
parent
commit
1296542909
2 changed files with 21 additions and 0 deletions
  1. 15 0
      app/JsonRpc/WebsiteService.php
  2. 6 0
      app/JsonRpc/WebsiteServiceInterface.php

+ 15 - 0
app/JsonRpc/WebsiteService.php

@@ -2993,4 +2993,19 @@ class WebsiteService implements WebsiteServiceInterface
         }
 
     }
+
+    /**
+     * 更新网站状态
+     * @param array $data
+     * @return array
+     */
+    public function updateWebsiteStatus(array $data): array
+    {
+        try {
+            Website::where(["id"=>$data['id']])->update(["status"=>intval($data['status'])]);
+            return Result::success([]);
+        }catch (\Exception $e){
+            return Result::error($e->getMessage(), 0);
+        }
+    }
 }

+ 6 - 0
app/JsonRpc/WebsiteServiceInterface.php

@@ -167,4 +167,10 @@ interface WebsiteServiceInterface
      */
     public function cloneWebsite(array $data): array;
 
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function updateWebsiteStatus(array $data): array;
+
 }