Преглед на файлове

初步建立随即模板的接口

15313670163 преди 5 месеца
родител
ревизия
7feb2ebad0
променени са 1 файла, в които са добавени 4 реда и са изтрити 3 реда
  1. 4 3
      app/JsonRpc/PublicRpcService.php

+ 4 - 3
app/JsonRpc/PublicRpcService.php

@@ -2699,7 +2699,7 @@ class PublicRpcService implements PublicRpcServiceInterface
         if(empty($web)){
         if(empty($web)){
             return Result::error('此网站不存在!');
             return Result::error('此网站不存在!');
         }
         }
-        $template = Template::where('website_id',$data['website_id'])->where('tempalte_id',$data['template_id'])->first();
+        $template = Template:: where('template_id',$data['template_id'])->first();
         if(empty($template)){
         if(empty($template)){
             return Result::error('此皮肤不存在!');
             return Result::error('此皮肤不存在!');
         }
         }
@@ -2708,11 +2708,12 @@ class PublicRpcService implements PublicRpcServiceInterface
             return Result::error('此规则不存在!');
             return Result::error('此规则不存在!');
         }
         }
         $template_id = $data['template_id'];
         $template_id = $data['template_id'];
-        $index = $this->randomPage($rule,$data['template_id']);
+        $index = $this->randomPage($rule,$template_id);
         return Result::success($index);
         return Result::success($index);
     }
     }
     public function randomPage($template_id,$rule){
     public function randomPage($template_id,$rule){
-        // $sectors = Sector::where('tempalte_id',$template_id)->rand
+        $sectors = Sector::where('template_id',$template_id)->limit(3)->get();
+        return $sectors;
     }
     }
     
     
 }
 }