OrderEnum.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace app\common\Enum;
  3. class OrderEnum
  4. {
  5. /**
  6. * 订单状态
  7. */
  8. const STATUS_CREATE = 101;
  9. const STATUS_PAY = 201;
  10. const STATUS_SHIP = 301;
  11. const STATUS_CONFIRM = 401;
  12. const STATUS_CANCEL = 102;
  13. const STATUS_AUTO_CANCEL = 103;
  14. const STATUS_ADMIN_CANCEL = 104;
  15. const STATUS_REFUND = 202;
  16. const STATUS_REFUND_CONFIRM = 203;
  17. const STATUS_GROUPON_TIMEOUT = 204;
  18. const STATUS_AUTO_CONFIRM = 402;
  19. const STATUS_TEXT_MAP = [
  20. self::STATUS_CREATE => '未付款',
  21. self::STATUS_CANCEL => "已取消",
  22. self::STATUS_AUTO_CANCEL => "已取消(系统)",
  23. self::STATUS_ADMIN_CANCEL => "已取消(管理员)",
  24. self::STATUS_PAY => "已付款",
  25. self::STATUS_REFUND => "订单取消,退款中",
  26. self::STATUS_REFUND_CONFIRM => "已退款",
  27. self::STATUS_GROUPON_TIMEOUT => "已超时团购",
  28. self::STATUS_SHIP => "已发货",
  29. self::STATUS_CONFIRM => "已收货",
  30. self::STATUS_AUTO_CONFIRM => "已收货(系统)",
  31. ];
  32. public static function getOrderStatusList()
  33. {
  34. return self::STATUS_TEXT_MAP;
  35. }
  36. public static function getOrderStatusText($status)
  37. {
  38. return self::STATUS_TEXT_MAP[$status] ?? '未知';
  39. }
  40. const SHOW_TYPE_ALL = 0;//全部订单
  41. const SHOW_TYPE_WAIT_PAY = 1;//待付款订单
  42. const SHOW_TYPE_WAIT_DELIVERY = 2;//待发货订单
  43. const SHOW_TYPE_WAIT_RECEIPT = 3;//待收货订单
  44. const SHOW_TYPE_WAIT_COMMENT = 4;//待评价订单
  45. const SHOW_TYPE_STATUS_MAP = [
  46. self::SHOW_TYPE_ALL => [],
  47. self::SHOW_TYPE_WAIT_PAY => [self::STATUS_CREATE],
  48. self::SHOW_TYPE_WAIT_DELIVERY => [self::STATUS_PAY],
  49. self::SHOW_TYPE_WAIT_RECEIPT => [self::STATUS_SHIP],
  50. self::SHOW_TYPE_WAIT_COMMENT => [self::STATUS_CONFIRM],
  51. ];
  52. }