SystemConfigService.php 706 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. *
  4. * @author: xaboy<365615158@qq.com>
  5. * @day: 2017/11/23
  6. */
  7. namespace service;
  8. use app\admin\model\system\SystemConfig;
  9. class SystemConfigService
  10. {
  11. protected static $configList = null;
  12. public static function config($key)
  13. {
  14. if(self::$configList === null) self::$configList = self::getAll();
  15. return isset(self::$configList[$key]) ? self::$configList[$key] : null;
  16. }
  17. public static function get($key)
  18. {
  19. return SystemConfig::getValue($key);
  20. }
  21. public static function more($keys)
  22. {
  23. return SystemConfig::getMore($keys);
  24. }
  25. public static function getAll()
  26. {
  27. return SystemConfig::getAllConfig()?:[];
  28. }
  29. }