Ver Fonte

add if(Str::isUuid($channelId)){

visuddhinanda há 2 anos atrás
pai
commit
96d4f2a95c
1 ficheiros alterados com 9 adições e 3 exclusões
  1. 9 3
      app/Http/Controllers/ViewController.php

+ 9 - 3
app/Http/Controllers/ViewController.php

@@ -26,10 +26,16 @@ class ViewController extends Controller
                 break;
             case 'chapter':
                 # code...
-                $target_id = ProgressChapter::where("channel_id",$request->get("channel"))
-                                            ->where("book",$request->get("book"))
-                                            ->where("para",$request->get("para"))
+                $channelId = $request->get("channel");
+                if(Str::isUuid($channelId)){
+                    $target_id = ProgressChapter::where("channel_id",$request->get("channel"))
+                                            ->where("book",$request->get("book",0))
+                                            ->where("para",$request->get("para",0))
                                             ->value("uid");
+                }else{
+                    $target_id = false;
+                }
+
                 break;
             case 'article-instance':
                 # code...