fly 5 gadi atpakaļ
vecāks
revīzija
b16d8a69b7

+ 7 - 3
app/Http/Controllers/QuickApp/Book/BookController.php

@@ -198,13 +198,17 @@ class BookController extends BaseController
 
     private function getBidCidFromUrl(string $url)
     {
-        if (preg_match('/bid=(\w+)\S+cid=(\w+)/', $url, $matches)) {
+        if (preg_match('/\?bid=(\w+)\S+cid=(\w+)/', $url, $matches) || preg_match('/\?id=(\w+)/', $url, $matches)) {
             return [
                 'bid' => $matches[1],
-                'cid' => $matches[2],
+                'cid' => isset($matches[2]) ? $matches[2] : 0,
+            ];
+        } else {
+            return [
+                'bid' => '',
+                'cid' => 0,
             ];
         }
-        return false;
     }