|
@@ -571,7 +571,11 @@ class NewsService implements NewsServiceInterface
|
|
return Result::error("暂无此网站",0);
|
|
return Result::error("暂无此网站",0);
|
|
}
|
|
}
|
|
if(isset($data['sur_id']) && !empty($data['sur_id'])){
|
|
if(isset($data['sur_id']) && !empty($data['sur_id'])){
|
|
- $survey = ArticleSurvey::where('sur_id',$data['sur_id'])->where('website_id',$data['website_id'])->pluck('sur_id');
|
|
|
|
|
|
+ $survey['data'] = ArticleSurvey::where('sur_id',$data['sur_id'])
|
|
|
|
+ ->where('website_id',$data['website_id'])
|
|
|
|
+ ->where('other_id', 0)
|
|
|
|
+ ->get();
|
|
|
|
+ return Result::success($survey);
|
|
if(empty($survey)){
|
|
if(empty($survey)){
|
|
return Result::error("此调查问卷不存在",0);
|
|
return Result::error("此调查问卷不存在",0);
|
|
}
|
|
}
|
|
@@ -600,6 +604,7 @@ class NewsService implements NewsServiceInterface
|
|
->where('other_id','!=',0)
|
|
->where('other_id','!=',0)
|
|
->first();
|
|
->first();
|
|
// return Result::success($data);
|
|
// return Result::success($data);
|
|
|
|
+ $choice_id = $data['choice_id'];
|
|
if(!empty($choice['other'])){
|
|
if(!empty($choice['other'])){
|
|
array_push($data['choice_id'],$choice['other']['other_id']);
|
|
array_push($data['choice_id'],$choice['other']['other_id']);
|
|
// return Result::success($data['choice_id']);
|
|
// return Result::success($data['choice_id']);
|
|
@@ -611,11 +616,8 @@ class NewsService implements NewsServiceInterface
|
|
if(empty($choice)){
|
|
if(empty($choice)){
|
|
return Result::error("请选择已有的选项!",0);
|
|
return Result::error("请选择已有的选项!",0);
|
|
}
|
|
}
|
|
- $retult_survey['data'] = ArticleSurvey::where('website_id', $data['website_id'])
|
|
|
|
- ->where('sur_id', $data['sur_id'])
|
|
|
|
- ->get();
|
|
|
|
- $retult_survey['choice'] = $data['choice_id'];
|
|
|
|
- return Result::success($retult_survey);
|
|
|
|
|
|
+ $survey['choice'] = $choice_id;
|
|
|
|
+ return Result::success($survey);
|
|
}
|
|
}
|
|
return Result::error("参数必填!");
|
|
return Result::error("参数必填!");
|
|
}
|
|
}
|