SystemStorageDao.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\dao\system\config;
  12. use app\dao\BaseDao;
  13. use app\model\system\config\SystemStorage;
  14. use crmeb\traits\SearchDaoTrait;
  15. /**
  16. * Class SystemStorageDao
  17. * @package app\dao\system\config
  18. */
  19. class SystemStorageDao extends BaseDao
  20. {
  21. use SearchDaoTrait;
  22. /**
  23. * @return string
  24. */
  25. protected function setModel(): string
  26. {
  27. return SystemStorage::class;
  28. }
  29. /**
  30. * @param array $where
  31. * @return \crmeb\basic\BaseModel|mixed|\think\Model
  32. */
  33. public function search(array $where = [])
  34. {
  35. return parent::search($where)->when(isset($where['type']), function ($query) use ($where) {
  36. $query->where('type', $where['type']);
  37. })->where('is_delete', 0)->when(isset($where['access_key']), function ($query) use ($where) {
  38. $query->where('access_key', $where['access_key']);
  39. });
  40. }
  41. }