tongshanglei 2 anos atrás
pai
commit
56d5823654
1 arquivos alterados com 12 adições e 5 exclusões
  1. 12 5
      catch/alarm/model/ControlAlarm.php

+ 12 - 5
catch/alarm/model/ControlAlarm.php

@@ -46,11 +46,18 @@ class ControlAlarm extends Model
             ->paginate();
         return $res;
     }
-    // //根据姓名搜索
-    // public function searchNameAttr($query, $value, $data)
-    // {
-    //     return $query->where('name', 'like', '%' . $value . '%');
-    // }
+    public function searchPlateNoAttr($query, $value, $data)
+    {
+        return $query->where('plate_no', 'like', '%' . $value . '%');
+    }
+    public function searchRfidSnAttr($query, $value, $data)
+    {
+        return $query->where('rfid_sn', 'like', '%' . $value . '%');
+    }
+    public function searchAlarmTypeAttr($query, $value, $data)
+    {
+        return $query->where('alarm_type',  $value);
+    }
 
     
     public function getStateTextAttr($value){