DeliveryDict.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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\delivery;
  12. /**
  13. *订单配送相关枚举类
  14. */
  15. class DeliveryDict
  16. {
  17. //订单状态
  18. //快递
  19. const EXPRESS = 'express';
  20. //同城
  21. const LOCAL_DELIVERY = 'local_delivery';
  22. /**
  23. * 获取配送方式(用于订单)
  24. * @param string $type
  25. * @return array|array[]|string
  26. */
  27. public static function getType(string $type = '')
  28. {
  29. $data = [
  30. self::EXPRESS => get_lang('dict_mall_delivery_type.express'),
  31. self::LOCAL_DELIVERY => get_lang('dict_mall_delivery_type.local_delivery'),
  32. ];
  33. if ($type == '') {
  34. return $data;
  35. }
  36. return $data[$type] ?? '';
  37. }
  38. }