|
@@ -766,11 +766,19 @@ class NewsService implements NewsServiceInterface
|
|
|
}
|
|
|
}
|
|
|
// return Result::success($data['choice_id']);
|
|
|
- $choice['other'] = ArticleSurvey::whereIn('id', $data['choice_id'])
|
|
|
- ->where('website_id', $data['website_id'])
|
|
|
- ->where('is_other', 1)
|
|
|
- ->where('other_id', '!=', 0)
|
|
|
- ->first();
|
|
|
+ $other = ArticleSurvey::whereIn('id',$data['choice_id'])
|
|
|
+ ->where('website_id',$data['website_id'])
|
|
|
+ ->where('is_other',1)
|
|
|
+ ->where('other_id',0)
|
|
|
+ ->first();
|
|
|
+ if(!empty($other)){
|
|
|
+ return Result::error("请选择已有的选项!",0);
|
|
|
+ }
|
|
|
+ $choice['other'] = ArticleSurvey::whereIn('id',$data['choice_id'])
|
|
|
+ ->where('website_id',$data['website_id'])
|
|
|
+ ->where('is_other',1)
|
|
|
+ ->where('other_id','!=',0)
|
|
|
+ ->first();
|
|
|
// return Result::success($data);
|
|
|
if (!empty($choice['other'])) {
|
|
|
array_push($data['choice_id'], $choice['other']['other_id']);
|