Setting.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2024 https://www.yiovo.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: 萤火科技 <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types=1);
  12. namespace app\api\model;
  13. use app\common\model\store\Setting as SettingModel;
  14. use app\common\enum\Setting as SettingEnum;
  15. /**
  16. * 系统设置模型
  17. * Class Setting
  18. * @package app\api\model
  19. */
  20. class Setting extends SettingModel
  21. {
  22. /**
  23. * 获取积分名称
  24. * @return string
  25. * @throws \think\db\exception\DataNotFoundException
  26. * @throws \think\db\exception\DbException
  27. * @throws \think\db\exception\ModelNotFoundException
  28. */
  29. public static function getPointsName(): string
  30. {
  31. return static::getItem(SettingEnum::POINTS)['points_name'];
  32. }
  33. /**
  34. * 获取未支付订单自动关闭期限(单位:小时)
  35. * @return mixed
  36. * @throws \think\db\exception\DataNotFoundException
  37. * @throws \think\db\exception\DbException
  38. * @throws \think\db\exception\ModelNotFoundException
  39. */
  40. public static function getOrderCloseTime()
  41. {
  42. return static::getItem(SettingEnum::TRADE)['order']['closeHours'];
  43. }
  44. /**
  45. * 获取充值设置
  46. * @return array
  47. * @throws \think\db\exception\DataNotFoundException
  48. * @throws \think\db\exception\DbException
  49. * @throws \think\db\exception\ModelNotFoundException
  50. */
  51. public static function getRecharge(): array
  52. {
  53. return static::getItem(SettingEnum::RECHARGE);
  54. }
  55. }