OrderSubscribe.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. /**
  3. *
  4. * @author: xaboy<365615158@qq.com>
  5. * @day: 2017/12/18
  6. */
  7. namespace crmeb\subscribes;
  8. use app\admin\model\order\StoreOrder as AdminStoreOrder;
  9. use app\models\store\StoreOrder;
  10. /**
  11. * 订单事件
  12. * Class OrderSubscribe
  13. * @package crmeb\subscribes
  14. */
  15. class OrderSubscribe
  16. {
  17. public function handle()
  18. {
  19. }
  20. /**
  21. * 送货发送模板消息
  22. * @param $event
  23. * @throws \think\db\exception\DataNotFoundException
  24. * @throws \think\db\exception\ModelNotFoundException
  25. * @throws \think\exception\DbException
  26. */
  27. public function onStoreProductOrderDeliveryAfter($event)
  28. {
  29. list($data,$oid) = $event;
  30. AdminStoreOrder::orderPostageAfter($oid,$data);
  31. }
  32. /**
  33. * 发货发送模板消息
  34. * @param $event
  35. * @throws \think\db\exception\DataNotFoundException
  36. * @throws \think\db\exception\ModelNotFoundException
  37. * @throws \think\exception\DbException
  38. */
  39. public function onStoreProductOrderDeliveryGoodsAfter($event)
  40. {
  41. list($data,$oid) = $event;
  42. AdminStoreOrder::orderPostageAfter($oid,$data);
  43. }
  44. /**
  45. * 订单状态不退款 发送模板消息
  46. * @param $event
  47. */
  48. public function onStoreProductOrderRefundNAfter($event)
  49. {
  50. list($data,$id) = $event;
  51. AdminStoreOrder::refundNoPrieTemplate($id,$data);
  52. }
  53. /**
  54. * 线下付款成功后
  55. * @param $event
  56. */
  57. public function onStoreProductOrderOffline($event)
  58. {
  59. list($id) = $event;
  60. //订单编号 $id
  61. }
  62. /**
  63. * 修改订单金额
  64. * @param $event
  65. */
  66. public function onStoreProductOrderEditAfter($event)
  67. {
  68. list($data,$id) = $event;
  69. //$data total_price 商品总价 pay_price 实际支付
  70. //订单编号 $id
  71. }
  72. /**
  73. * 修改配送信息
  74. * @param $event
  75. */
  76. public function onStoreProductOrderDistributionAfter($event)
  77. {
  78. list($data,$id) = $event;
  79. //$data 送货人姓名/快递公司 送货人电话/快递单号
  80. //订单编号 $id
  81. }
  82. /**
  83. * 订单全部产品评价完
  84. * @param $event
  85. */
  86. public function onStoreProductOrderOver($event)
  87. {
  88. list($oid) = $event;
  89. }
  90. /**
  91. * 回退所有 未支付和已退款的状态下才可以退积分退库存退优惠券
  92. * @param $event
  93. */
  94. public function onStoreOrderRegressionAllAfter($event)
  95. {
  96. list($order) = $event;
  97. StoreOrder::RegressionStock($order) && StoreOrder::RegressionIntegral($order) && StoreOrder::RegressionCoupon($order);
  98. }
  99. }