Browse Source

获取风机信息

likang 2 years ago
parent
commit
664cf882da
2 changed files with 10 additions and 3 deletions
  1. 1 3
      catch/wind/controller/Fan.php
  2. 9 0
      catch/wind/model/Fan.php

+ 1 - 3
catch/wind/controller/Fan.php

@@ -38,9 +38,7 @@ class Fan extends CatchController
      */
     public function getList(Request $request)
     {
-        $datalist = $this->fanModel->field('id,number')->select();
-
-        return CatchResponse::success($datalist);
+        return CatchResponse::success($this->fanModel->getFanList());
     }
     
     /**

+ 9 - 0
catch/wind/model/Fan.php

@@ -46,4 +46,13 @@ class Fan extends Model
         ->creator()
         ->paginate();
     }
+    public function getFanList()
+    {
+        return $this->dataRange()
+        ->catchSearch()
+        ->field('id,number')
+        ->catchOrder()
+        ->creator()
+        ->select();
+    }
 }