DeviceSearch.php 528 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace catchAdmin\device\model\search;
  3. use catchAdmin\system\model\SysDictData;
  4. use Exception;
  5. use think\facade\Db;
  6. trait DeviceSearch
  7. {
  8. /**
  9. * 根据部门搜索
  10. */
  11. public function searchNameAttr($query, $value, $data)
  12. {
  13. return $query->where('DEVICE_NAME', 'like', '%'.$value.'%');
  14. }
  15. /**
  16. * 根据imei搜索
  17. */
  18. public function searchShortCodeAttr($query, $value, $data)
  19. {
  20. return $query->where('DEVICE_CODE', 'like', '%'.$value.'%');
  21. }
  22. }