Explorar el Código

无记录不返回error

visuddhinanda hace 2 años
padre
commit
97034e260e
Se han modificado 1 ficheros con 3 adiciones y 5 borrados
  1. 3 5
      app/Http/Controllers/CourseController.php

+ 3 - 5
app/Http/Controllers/CourseController.php

@@ -115,11 +115,9 @@ class CourseController extends Controller
                        ->take($request->get('limit',1000));
 
         $result = $table->get();
-		if($result){
-			return $this->ok(["rows"=>CourseResource::collection($result),"count"=>$count]);
-		}else{
-			return $this->error("没有查询到数据");
-		}
+
+		return $this->ok(["rows"=>CourseResource::collection($result),"count"=>$count]);
+
     }
     /**
      * Display a listing of the resource.