GoodsDict.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. const SINGLE_TIME = 1;//单次限购
  19. const SINGLE_PERSON = 2;//单人限购
  20. /**
  21. * 商品类型
  22. * @param $type
  23. * @return array|mixed|string
  24. */
  25. public static function getType($type = '')
  26. {
  27. $list = [
  28. self::REAL => [
  29. 'type' => self::REAL,
  30. 'name' => get_lang('dict_mall_goods.real'),
  31. 'desc' => get_lang('dict_mall_goods.real_desc'),
  32. 'path' => '/mall/goods/real_edit',
  33. ],
  34. self::VIRTUAL => [
  35. 'type' => self::VIRTUAL,
  36. 'name' => get_lang('dict_mall_goods.virtual'),
  37. 'desc' => get_lang('dict_mall_goods.virtual_desc'),
  38. 'path' => '/mall/goods/virtual_edit',
  39. ]
  40. ];
  41. if ($type == '') return $list;
  42. return $list[ $type ];
  43. }
  44. }