Explorar o código

过滤错误的id

visuddhinanda %!s(int64=3) %!d(string=hai) anos
pai
achega
0ccd4b21bd
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      app/Http/Controllers/SentenceController.php

+ 3 - 1
app/Http/Controllers/SentenceController.php

@@ -143,7 +143,9 @@ class SentenceController extends Controller
         foreach ($sent as $value) {
         foreach ($sent as $value) {
             # code...
             # code...
             $ids = explode('-',$value);
             $ids = explode('-',$value);
-            $query[] = $ids;
+            if(count($ids)===4){
+                $query[] = $ids;
+            }
         }
         }
         $table = Sentence::select(['id','book_id','paragraph','word_start','word_end','content','channel_uid','updated_at'])
         $table = Sentence::select(['id','book_id','paragraph','word_start','word_end','content','channel_uid','updated_at'])
                         ->where('channel_uid', $request->get('channel'))
                         ->where('channel_uid', $request->get('channel'))