OrderStatus.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\common\repositories\store\order;
  12. use app\common\model\store\order\StoreOrder;
  13. class OrderStatus
  14. {
  15. //订单支付状态:0-未支付,1-已支付
  16. const PAY_STATUS_UNPAID = 0;
  17. const PAY_STATUS_PAID = 1;
  18. /**
  19. * 订单主流程 status 字段
  20. * (订单支付状态 0-未支付)
  21. * 下单 -> 待付款
  22. *
  23. * (订单支付状态 1-已支付)
  24. * 待发货 -> 待收货 -> 待评价 -> 已完成
  25. * 通用订单状态(0:待发货;1:待收货;2:待评价;3:已完成;)
  26. *
  27. * -1:已退款
  28. * is_del = 1 已取消
  29. */
  30. const ORDER_STATUS_PENDING_SHIPMENT = 0; // 待发货
  31. const ORDER_STATUS_PENDING_RECEIPT = 1; // 待收货
  32. const ORDER_STATUS_PENDING_REVIEW = 2; // 待评价
  33. const ORDER_STATUS_COMPLETED = 3; // 已完成
  34. const ORDER_STATUS_REFUND = -1; // 已退款
  35. /**
  36. * 其他扩展状态:9: 拼团中 10: 待付尾款 11: 尾款超时未付 20 : 预约订单服务中【已打卡/待核销】
  37. */
  38. const ORDER_STATUS_GROUPING = 9;
  39. const ORDER_STATUS_PENDING_PAY_TAIL = 10;
  40. const ORDER_STATUS_PENDING_PAY_TIMEOUT = 11;
  41. const RESERVATION_ORDER_STATUS_INSERVICE = 20;
  42. /**
  43. * product_type = 0 && is_virtual = 4 预约商品订单
  44. *
  45. * 预约商品订单流程
  46. * 下单 -> 待付款 ->
  47. * status
  48. * 待指派/领取 -> 待服务 -> [已打卡 -> ] 核销 -> 待评价 -> 完成
  49. * status 0:待发货; 1:待收货; 20 已打卡/待核销 2:待评价; 3:已完成;
  50. * order_type = 0 上门 1 到店
  51. * (status = 20 || (order_type == 1 && status == 1)) 待核销
  52. *
  53. *
  54. */
  55. const ORDER_STATUS_CHECKIN = 20;
  56. public static function getStatusText($order, $product_type = 0, $type = 0)
  57. {
  58. $status = $order;
  59. if ($order instanceof StoreOrder) {
  60. $status = $order->status;
  61. $product_type = $order->product_type;
  62. $type = $order->type;
  63. }
  64. switch ($product_type) {
  65. case 0:
  66. break;
  67. default:
  68. break;
  69. }
  70. }
  71. }