|
@@ -855,12 +855,9 @@ class NewsService implements NewsServiceInterface
|
|
|
return Result::error("暂无此网站",0);
|
|
|
}
|
|
|
if(isset($data['sur_id']) && !empty($data['sur_id'])){
|
|
|
- $survey['data'] = ArticleSurvey::where('sur_id',$data['sur_id'])
|
|
|
- ->where('website_id',$data['website_id'])
|
|
|
- ->where('other_id', 0)
|
|
|
- ->get();
|
|
|
+ $is_survey = ArticleSurvey::where('sur_id',$data['sur_id'])->first();
|
|
|
// return Result::success($survey);
|
|
|
- if(empty($survey)){
|
|
|
+ if(empty($is_survey)){
|
|
|
return Result::error("此调查问卷不存在",0);
|
|
|
}
|
|
|
// return Result::success($survey);
|
|
@@ -910,6 +907,10 @@ class NewsService implements NewsServiceInterface
|
|
|
if (empty($choice)) {
|
|
|
return Result::error("请选择已有的选项!", 0);
|
|
|
}
|
|
|
+ $survey['data'] = ArticleSurvey::where('sur_id',$data['sur_id'])
|
|
|
+ ->where('website_id',$data['website_id'])
|
|
|
+ ->where('other_id', 0)
|
|
|
+ ->get();
|
|
|
$survey['choice'] = $choice_id;
|
|
|
return Result::success($survey);
|
|
|
}
|