|
@@ -549,7 +549,7 @@ class NewsService implements NewsServiceInterface
|
|
if(empty($result)){
|
|
if(empty($result)){
|
|
return Result::error("添加失败",0);
|
|
return Result::error("添加失败",0);
|
|
}
|
|
}
|
|
- return Result::success($data);
|
|
|
|
|
|
+ return Result::success($result);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return Result::error("添加失败",0);
|
|
return Result::error("添加失败",0);
|
|
@@ -564,14 +564,7 @@ class NewsService implements NewsServiceInterface
|
|
*/
|
|
*/
|
|
public function addWebsiteSurveyVote(array $data): array
|
|
public function addWebsiteSurveyVote(array $data): array
|
|
{
|
|
{
|
|
- // $choice_id = $data['choice_id'];
|
|
|
|
- // return Result::success($data);
|
|
|
|
- if(is_array($data['choice_id'])){
|
|
|
|
- if (!is_array($data['choice_id'])) {
|
|
|
|
- $data['choice_id'] = [$data['choice_id']];
|
|
|
|
- }
|
|
|
|
- $data['choice_id'] = array_map('intval', $data['choice_id']);
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
if(isset($data['website_id']) && !empty($data['website_id'])){
|
|
if(isset($data['website_id']) && !empty($data['website_id'])){
|
|
$website = Website::where('id',$data['website_id'])->first();
|
|
$website = Website::where('id',$data['website_id'])->first();
|
|
if(empty($website)){
|
|
if(empty($website)){
|