|
@@ -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;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|