Ver Fonte

_GET 改为 $request->get

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

+ 2 - 2
app/Http/Controllers/CollectionController.php

@@ -59,8 +59,8 @@ class CollectionController extends Controller
 			    return $this->error("没有查询到数据");
 				break;
 		}
-        if(isset($_GET["search"])){
-            $table = $table->where('title', 'like', $_GET["search"]."%");
+        if($request->has("search") && !empty($request->has("search"))){
+            $table = $table->where('title', 'like', "%".$request->get("search")."%");
         }
         $count = $table->count();
         if(isset($_GET["order"]) && isset($_GET["dir"])){