SettingEnum.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace common\enums;
  3. /**
  4. *
  5. * 设置枚举
  6. * Class SettingEnum
  7. * @package common\enums
  8. */
  9. class SettingEnum
  10. {
  11. const MALL_BASIC = 'mall_basic';
  12. const MALL_ASSETS = 'mall_assets';
  13. const MALL_ORDER = 'mall_order';
  14. const MALL_USER = 'mall_user';
  15. const PAY = 'pay';
  16. const MALL_CART = 'mall_cart'; //购物车
  17. const MALL_STORAGE = 'mall_storage';
  18. const MALL_CAT = 'mall_cat';//发薪猫
  19. /**
  20. * 根据类型获取商城设置的配置
  21. * @Author: lun
  22. * @DateTime: 2021/10/15 0015 18:14
  23. * @Copyright: copyright (c) 2021 广东七件事集团
  24. * @param string $type
  25. * @return array|string[]|\string[][]
  26. */
  27. public static function getMallType($type = ''): array
  28. {
  29. $data = [
  30. self::MALL_BASIC => ['basic', 'logistics', 'service', 'copyright', 'follow', 'user', 'pay', 'notice_wechat', 'notice_sms', 'notice_alipay','goods','order_pay','order_comment','printer','sensitive','area','upgrade','goodsdetail'],
  31. self::MALL_ASSETS => ['withdraw_balance','withdraw_income','recharge','score','balance','digital', 'other'],
  32. self::MALL_ORDER => ['order', 'return_address', 'freight', 'marketing'],
  33. self::MALL_USER => ['user', 'user_agree','user_custom_text','user_operate','user_reward','user_reward_redpacket'],
  34. self::MALL_STORAGE => ['storage', 'storage_driver', 'limit'],
  35. self::MALL_CART => ['cart'],
  36. self::MALL_CAT => ['cat']
  37. ];
  38. return $type ? $data[$type] : $data;
  39. }
  40. /**
  41. * 获取平台配置
  42. * @Author: lun
  43. * @DateTime: 2022/2/24 0024 18:49
  44. * @Copyright: copyright (c) 2021 广东七件事集团
  45. * @param string $type
  46. * @return string[]|\string[][]
  47. */
  48. public static function getPlatformType($type = '')
  49. {
  50. $data = [
  51. self::PAY => ['wechat', 'alipay','addons'],
  52. ];
  53. return $type ? $data[$type] : $data;
  54. }
  55. }