소스 검색

修改c端投票-投票

15313670163 1 개월 전
부모
커밋
db3a3282f8
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      app/JsonRpc/NewsService.php

+ 8 - 0
app/JsonRpc/NewsService.php

@@ -578,6 +578,14 @@ class NewsService implements NewsServiceInterface
                         }
                     }
                     // return Result::success($data['choice_id']);
+                    $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)