DeliveryEnum.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop100%开源免费商用商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | 商业版本务必购买商业授权,以免引起法律纠纷
  8. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  9. // | gitee下载:https://gitee.com/likeshop_gitee
  10. // | github下载:https://github.com/likeshop-github
  11. // | 访问官网:https://www.likeshop.cn
  12. // | 访问社区:https://home.likeshop.cn
  13. // | 访问手册:http://doc.likeshop.cn
  14. // | 微信公众号:likeshop技术社区
  15. // | likeshop团队 版权所有 拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshopTeam
  18. // +----------------------------------------------------------------------
  19. namespace app\common\enum;
  20. class DeliveryEnum
  21. {
  22. //配送方式
  23. const EXPRESS_DELIVERY = 1;//快递发货
  24. const SELF_DELIVERY = 2;//门店自提
  25. // const SAME_CITY = 3;//同城配送
  26. const DELIVERY_VIRTUAL = 4;//虚拟发货
  27. //配送状态
  28. const NOT_SHIPPED = 0;//未发货
  29. const SHIPPED = 1;//已发货
  30. const PART_SHIPPED = 2;//部分发货
  31. //发货方式
  32. const EXPRESS = 1;//快递配送
  33. const NO_EXPRESS = 2;//无需快递
  34. // 所有配送方式
  35. const DELIVERY_TYPE = [
  36. self::EXPRESS_DELIVERY,
  37. self::SELF_DELIVERY,
  38. // self::SAME_CITY,
  39. self::DELIVERY_VIRTUAL,
  40. ];
  41. // 电子面单支付方式
  42. const SENDER_PAYMENT = 1;
  43. const ARRIVAL_PAYMENT = 2;
  44. const MONTHLY = 3;
  45. const THIRD_PARTY_PAYMENT = 4;
  46. /**
  47. * @notes 获取电子面单支付方式
  48. * @param null $payment
  49. * @return string|string[]
  50. * @author Tab
  51. * @date 2021/11/22 14:31
  52. */
  53. public static function getFaceSheetPaymentDesc($payment = null)
  54. {
  55. $desc = [
  56. self::SENDER_PAYMENT => '寄方付',
  57. self::ARRIVAL_PAYMENT => '到付',
  58. self::MONTHLY => '月结',
  59. self::THIRD_PARTY_PAYMENT => '第三方支付',
  60. ];
  61. if (is_null($payment)) {
  62. return $desc;
  63. }
  64. return $desc[$payment] ?? '';
  65. }
  66. /**
  67. * @notes 获取快递100对应的支付方式
  68. * @param null $payment
  69. * @return string|string[]
  70. * @author Tab
  71. * @date 2021/11/23 11:31
  72. */
  73. public static function getKuaidi100Desc($payment = null)
  74. {
  75. $desc = [
  76. self::SENDER_PAYMENT => 'SHIPPER',
  77. self::ARRIVAL_PAYMENT => 'CONSIGNEE',
  78. self::MONTHLY => 'MONTHLY',
  79. self::THIRD_PARTY_PAYMENT => 'THIRDPARTY',
  80. ];
  81. if (is_null($payment)) {
  82. return $desc;
  83. }
  84. return $desc[$payment] ?? '';
  85. }
  86. /**
  87. * @notes 配送方式
  88. * @param bool $value
  89. * @return string|string[]
  90. * @author ljj
  91. * @date 2021/8/5 9:53 上午
  92. */
  93. public static function getDeliveryTypeDesc($value = true)
  94. {
  95. $data = [
  96. self::EXPRESS_DELIVERY => '快递发货',
  97. self::SELF_DELIVERY => '门店自提',
  98. // self::SAME_CITY => '同城配送',
  99. self::DELIVERY_VIRTUAL => '虚拟发货'
  100. ];
  101. if (true === $value) {
  102. return $data;
  103. }
  104. return $data[$value] ?? '';
  105. }
  106. /**
  107. * @notes 配送状态
  108. * @param bool $value
  109. * @return string|string[]
  110. * @author ljj
  111. * @date 2021/8/6 4:57 下午
  112. */
  113. public static function getDeliveryStatusDesc($value = true)
  114. {
  115. $data = [
  116. self::NOT_SHIPPED => '未发货',
  117. self::PART_SHIPPED => '部分发货',
  118. self::SHIPPED => '已发货',
  119. ];
  120. if (true === $value) {
  121. return $data;
  122. }
  123. return $data[$value];
  124. }
  125. /**
  126. * @notes 发货方式
  127. * @param bool $value
  128. * @return string|string[]
  129. * @author ljj
  130. * @date 2021/8/13 3:38 下午
  131. */
  132. public static function getSendTypeDesc($value = true)
  133. {
  134. $data = [
  135. self::EXPRESS => '快递配送',
  136. self::NO_EXPRESS => '无需快递',
  137. ];
  138. if (true === $value) {
  139. return $data;
  140. }
  141. return $data[$value];
  142. }
  143. }