|
@@ -764,14 +764,19 @@ class NewsService implements NewsServiceInterface
|
|
|
}
|
|
|
// return Result::error($data,0);
|
|
|
$where['art_id'] = $data['art_id'];
|
|
|
- // $query = ArticleSurvey::where('art_id',$data['art_id']);
|
|
|
-
|
|
|
- } else {
|
|
|
- $survey = ArticleSurvey::where('website_id', $data['website_id'])->orderBy('created_at')->first();
|
|
|
- if (empty($survey)) {
|
|
|
- return Result::error("暂无调查问卷", 0);
|
|
|
+ // $query = ArticleSurvey::where('art_id',$data['art_id']);
|
|
|
+
|
|
|
+ }else{
|
|
|
+ $survey = Article::where('catid',28)
|
|
|
+ ->where('status',1)
|
|
|
+ ->where('is_survey',1)
|
|
|
+ ->select('survey_id')
|
|
|
+ ->orderBy('updated_at','desc')
|
|
|
+ ->first();
|
|
|
+ if(empty($survey)){
|
|
|
+ return Result::error("暂无调查问卷",0);
|
|
|
}
|
|
|
- $where['sur_id'] = $survey['sur_id'];
|
|
|
+ $where['sur_id'] = $survey['survey_id'];
|
|
|
// $query = ArticleSurvey::where('sur_id',$survey['sur_id']);
|
|
|
}
|
|
|
// return Result::success($where);
|