Browse Source

有fork参数只查带有fork的记录

visuddhinanda 2 years ago
parent
commit
34bc8ea5a3
1 changed files with 4 additions and 1 deletions
  1. 4 1
      app/Http/Controllers/SentHistoryController.php

+ 4 - 1
app/Http/Controllers/SentHistoryController.php

@@ -25,11 +25,14 @@ class SentHistoryController extends Controller
                 return $this->error('known view');
                 return $this->error('known view');
                 break;
                 break;
         }
         }
+        if($request->has('fork')){
+            $table = $table->whereNotNull('fork_from');
+        }
         $count = $table->count();
         $count = $table->count();
         $table->orderBy($request->get('order','created_at'),
         $table->orderBy($request->get('order','created_at'),
                         $request->get('dir','desc'));
                         $request->get('dir','desc'));
         $table->skip($request->get("offset",0))
         $table->skip($request->get("offset",0))
-              ->take($request->get('limit',1000));
+              ->take($request->get('limit',100));
 
 
         $result = $table->get();
         $result = $table->get();
 		return $this->ok(["rows"=>SentHistoryResource::collection($result),"count"=>$count]);
 		return $this->ok(["rows"=>SentHistoryResource::collection($result),"count"=>$count]);