SystemStorage.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\model\system\config;
  12. use crmeb\basic\BaseModel;
  13. /**
  14. * 云存储
  15. * Class SystemStorage
  16. * @package app\model\system\config
  17. */
  18. class SystemStorage extends BaseModel
  19. {
  20. /**
  21. * @var string
  22. */
  23. protected $name = 'system_storage';
  24. /**
  25. * @var string
  26. */
  27. protected $pk = 'id';
  28. /**
  29. * @var bool
  30. */
  31. protected $autoWriteTimestamp = false;
  32. /**
  33. * @param $query
  34. * @param $value
  35. */
  36. public function searchNameAttr($query, $value)
  37. {
  38. $query->where('name', $value);
  39. }
  40. /**
  41. * @param $query
  42. * @param $value
  43. */
  44. public function searchTypeAttr($query, $value)
  45. {
  46. if ($value !== '') {
  47. $query->where('type', $value);
  48. }
  49. }
  50. /**
  51. * 状态搜索器
  52. * @param $query
  53. * @param $value
  54. */
  55. public function searchStatusAttr($query, $value)
  56. {
  57. if ($value !== '') $query->where('status', $value);
  58. }
  59. }