Kaynağa Gözat

_GET 改为 $request->get

visuddhinanda 3 yıl önce
ebeveyn
işleme
e08f52e01f

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

@@ -59,8 +59,8 @@ class CollectionController extends Controller
 			    return $this->error("没有查询到数据");
 			    return $this->error("没有查询到数据");
 				break;
 				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();
         $count = $table->count();
         if(isset($_GET["order"]) && isset($_GET["dir"])){
         if(isset($_GET["order"]) && isset($_GET["dir"])){