|
|
@@ -2690,6 +2690,29 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
}
|
|
|
return Result::success($sector);
|
|
|
}
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 自助建站-随机获取模板
|
|
|
+ */
|
|
|
+ public function randomWebTemplate(array $data): array
|
|
|
+ {
|
|
|
+ $web = Website::where('id',$data['website_id'])->first();
|
|
|
+ if(empty($web)){
|
|
|
+ return Result::error('此网站不存在!');
|
|
|
+ }
|
|
|
+ $template = Template::where('website_id',$data['website_id'])->where('tempalte_id',$data['template_id'])->first();
|
|
|
+ if(empty($template)){
|
|
|
+ return Result::error('此皮肤不存在!');
|
|
|
+ }
|
|
|
+ $rule = TemplateRule::first();
|
|
|
+ if(empty($rule)){
|
|
|
+ return Result::error('此规则不存在!');
|
|
|
+ }
|
|
|
+ $template_id = $data['template_id'];
|
|
|
+ $index = $this->randomPage($rule,$data['template_id']);
|
|
|
+ return Result::success($index);
|
|
|
+ }
|
|
|
+ public function randomPage($template_id,$rule){
|
|
|
+ // $sectors = Sector::where('tempalte_id',$template_id)->rand
|
|
|
+ }
|
|
|
|
|
|
}
|