Explorar o código

add updated_at at index

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

+ 6 - 0
app/Http/Controllers/ChannelController.php

@@ -174,6 +174,12 @@ class ChannelController extends Controller
         if($request->has("type")){
             $table = $table->where('type', $request->get("type"));
         }
+        if($request->has("updated_at")){
+            $table = $table->where('updated_at','>', $request->get("updated_at"));
+        }
+        if($request->has("created_at")){
+            $table = $table->where('created_at','>', $request->get("created_at"));
+        }
         //获取记录总条数
         $count = $table->count();
         //处理排序