瀏覽代碼

修改自助建站-编辑底部导航名称接口

15313670163 4 月之前
父節點
當前提交
6dd9d7516c
共有 3 個文件被更改,包括 3 次插入2 次删除
  1. 1 1
      app/JsonRpc/FooterService.php
  2. 1 0
      app/JsonRpc/WebsiteService.php
  3. 1 1
      runtime/hyperf.pid

+ 1 - 1
app/JsonRpc/FooterService.php

@@ -99,7 +99,7 @@ class FooterService implements FooterServiceInterface
                 'web'=>$web
             ];
         }else{
-            $all_categories = FooterCategory::where('website_id',$data['website_id'])->pluck('name')->toArray();
+            $all_categories = FooterCategory::where('website_id',$data['website_id'])->where('id','!=',$data['id'])->pluck('name')->toArray();
             // 检查修改后的数据是否与已有数据重复
             if (in_array($data['name'], $all_categories)) {
                 return Result::error("修改后的底部导航名称已存在!");

+ 1 - 0
app/JsonRpc/WebsiteService.php

@@ -20,6 +20,7 @@ use App\Model\WebsiteRole;
 use App\Model\WebsiteRoleUser;
 use App\Model\Website;
 use App\Model\WebsiteColumn;
+use App\Model\Sector;
 use Hyperf\DbConnection\Db;
 use Hyperf\RpcServer\Annotation\RpcService;
 use App\Tools\Result;

+ 1 - 1
runtime/hyperf.pid

@@ -1 +1 @@
-3898
+3898