Эх сурвалжийг харах

修改接口:更新组件预览图

15313670163 19 цаг өмнө
parent
commit
f8e3a89113

+ 2 - 7
app/JsonRpc/PublicRpcService.php

@@ -2654,13 +2654,8 @@ class PublicRpcService implements PublicRpcServiceInterface
         if(empty($component)){
             return Result::error('组件不存在!');
         }
-
-        $img = ComponentImg::where('id','!=',$data['id'])->where('component_id',$data['component_id'])->where('template_id',$data['template_id'])->get()->all();
-        if(!empty($img)){
-            return Result::error('该组件已存在此皮肤的预览图!');
-        }
-         if($component['type_id'] == 11){
-             $img = ComponentImg::where('component_id',$data['component_id'])->where('template_id',$data['template_id'])->get()->all();
+        if($component['type_id'] == 11){
+            $img = ComponentImg::where('id','!=',$data['id'])->where('component_id',$data['component_id'])->where('template_id',$data['template_id'])->get()->all();
             if(!empty($img)){
                 return Result::error('该组件已存在此皮肤的预览图!');
             }