Browse Source

c端-修改投票

15313670163 1 month ago
parent
commit
49ae3f9f98
2 changed files with 13 additions and 5 deletions
  1. 13 5
      app/JsonRpc/NewsService.php
  2. 0 0
      runtime/container/scan.cache

+ 13 - 5
app/JsonRpc/NewsService.php

@@ -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']);

File diff suppressed because it is too large
+ 0 - 0
runtime/container/scan.cache


Some files were not shown because too many files changed in this diff