AttachmentsSearch.php 1.0 KB

1234567891011121314151617181920212223242526272829
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CatchAdmin [Just Like ~ ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
  8. // +----------------------------------------------------------------------
  9. // | Author: JaguarJack [ njphper@gmail.com ]
  10. // +----------------------------------------------------------------------
  11. namespace catchAdmin\system\model\search;
  12. trait AttachmentsSearch
  13. {
  14. public function searchFileExtAttr($query, $value, $data)
  15. {
  16. return $query->where('file_ext', $value);
  17. }
  18. public function searchMimeTypesAttr($query, $value, $data)
  19. {
  20. return $query->where('mime_type', $value);
  21. }
  22. public function searchDriverAttr($query, $value, $data)
  23. {
  24. return $query->where('driver', $value);
  25. }
  26. }