SystemConfigContent.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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\admin\model\system;
  12. use basic\ModelBasic;
  13. use traits\ModelTrait;
  14. /**
  15. * Class SystemConfigContent
  16. * @package app\admin\model\system
  17. */
  18. class SystemConfigContent extends ModelBasic
  19. {
  20. use ModelTrait;
  21. /**
  22. * 配置数据
  23. * @var array
  24. */
  25. protected static $config;
  26. public static function initialWhere()
  27. {
  28. return self::where(['is_del' => 0, 'is_show' => 1]);
  29. }
  30. /**
  31. * 获取配置
  32. * @param $name
  33. * @return string
  34. */
  35. public static function getValue($name, $filed = 'config_name', $valueName = 'content')
  36. {
  37. $content = self::initialWhere()->where([$filed => $name])->value($valueName);
  38. return htmlspecialchars_decode($content);
  39. }
  40. }