SystemStorage.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2023 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. * 类型搜索器
  42. * @param $query
  43. * @param $value
  44. */
  45. public function searchTypeAttr($query, $value)
  46. {
  47. if ($value) $query->where('type', $value);
  48. }
  49. /**
  50. * 状态搜索器
  51. * @param $query
  52. * @param $value
  53. */
  54. public function searchStatusAttr($query, $value)
  55. {
  56. if ($value !== '') $query->where('status', $value);
  57. }
  58. }