GoodsStatusDict.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 GoodsStatusDict
  13. {
  14. // 销售中
  15. const ONLINE = 1;
  16. // 仓库中
  17. const OFFLINE = 0;
  18. //待审核
  19. const WAIT_AUDIT = -1;
  20. //未审核通过
  21. const AUDIT_REFUSE = -2;
  22. //强制下架
  23. const AUDI_TO_FINE = -3;
  24. /**
  25. * 商品状态
  26. * @param $type
  27. * @return array|mixed|string
  28. */
  29. public static function getType($type = '')
  30. {
  31. $list = [
  32. 'goods_status_' . self::ONLINE => [
  33. 'value' => self::ONLINE,
  34. 'label' => get_lang('dict_mall_goods_status.online'),
  35. ],
  36. 'goods_status_' . self::OFFLINE => [
  37. 'value' => self::OFFLINE,
  38. 'label' => get_lang('dict_mall_goods_status.offline'),
  39. ],
  40. 'goods_status_' . self::WAIT_AUDIT => [
  41. 'value' => self::WAIT_AUDIT,
  42. 'label' => get_lang('dict_mall_goods_status.wait_audit'),
  43. ],
  44. 'goods_status_' . self::AUDIT_REFUSE => [
  45. 'value' => self::AUDIT_REFUSE,
  46. 'label' => get_lang('dict_mall_goods_status.audit_refuse'),
  47. ],
  48. 'goods_status_' . self::AUDI_TO_FINE => [
  49. 'value' => self::AUDI_TO_FINE,
  50. 'label' => get_lang('dict_mall_goods_status.audi_to_fine'),
  51. ],
  52. ];
  53. if ($type == '') return $list;
  54. return $list[ $type ];
  55. }
  56. }