GoodsDict.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的多应用管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace addon\mall\app\dict\goods;
  12. class GoodsDict
  13. {
  14. // 实物商品
  15. const REAL = 'real';
  16. // 虚拟商品
  17. const VIRTUAL = 'virtual';
  18. /**
  19. * 商品类型
  20. * @param $type
  21. * @return array|mixed|string
  22. */
  23. public static function getType($type = '')
  24. {
  25. $list = [
  26. self::REAL => [
  27. 'type' => self::REAL,
  28. 'name' => get_lang('dict_mall_goods.real'),
  29. 'desc' => get_lang('dict_mall_goods.real_desc'),
  30. 'path' => '/mall/goods/real_edit',
  31. ],
  32. self::VIRTUAL => [
  33. 'type' => self::VIRTUAL,
  34. 'name' => get_lang('dict_mall_goods.virtual'),
  35. 'desc' => get_lang('dict_mall_goods.virtual_desc'),
  36. 'path' => '/mall/goods/virtual_edit',
  37. ]
  38. ];
  39. if ($type == '') return $list;
  40. return $list[ $type ];
  41. }
  42. }