Explorar o código

自助建站-皮肤管理-修改删除皮肤的接口

15313670163 hai 2 días
pai
achega
5b712e7819
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  1. 6 2
      app/JsonRpc/PublicRpcService.php

+ 6 - 2
app/JsonRpc/PublicRpcService.php

@@ -903,8 +903,12 @@ class PublicRpcService implements PublicRpcServiceInterface
         if (!empty($rector)) {
             return Result::error("此皮肤已被绑定通栏,不可删除", 0);
         }
-        $template = WebsiteTemplateInfo::where('template_id', $data['id'])->first();
-        if (empty($template)) {
+        $template = Template::where('id', $data['id'])->first();
+        if(empty($template)){
+            return Result::error("此皮肤不存在!", 0);
+        }
+        $web_template = WebsiteTemplateInfo::where('template_id', $template['template_id'])->first();
+        if (empty($web_template)) {
             return Result::error("此皮肤已被绑定网站,不可删除", 0);
         }
         if ($template->type == 1) {