OrderBehavior.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <?php
  2. /**
  3. *
  4. * @author: xaboy<365615158@qq.com>
  5. * @day: 2017/12/18
  6. */
  7. namespace behavior\system;
  8. use app\admin\model\user\User;
  9. use app\admin\model\user\UserAddress;
  10. use app\admin\model\user\UserBill;
  11. use app\admin\model\wechat\WechatUser;
  12. use basic\ModelBasic;
  13. use app\admin\model\order\StoreOrder;
  14. use service\SystemConfigService;
  15. use service\WechatTemplateService;
  16. class OrderBehavior
  17. {
  18. /**
  19. * 修改发货状态 为送货
  20. * @param $data
  21. * $data array 送货方式 送货人姓名 送货人电话
  22. * @param $oid
  23. * $oid string store_order表中的id
  24. */
  25. public static function storeProductOrderDeliveryAfter($data,$oid){
  26. StoreOrder::orderPostageAfter($oid,$data);
  27. StoreOrder::sendOrderGoods($oid,$data);
  28. }
  29. /**
  30. * 修改发货状态 为发货
  31. * @param $data
  32. * $data array 发货方式 送货人姓名 送货人电话
  33. * @param $oid
  34. * $oid string store_order表中的id
  35. */
  36. public static function storeProductOrderDeliveryGoodsAfter($data,$oid){
  37. StoreOrder::orderPostageAfter($oid,$data);
  38. StoreOrder::sendOrderGoods($oid,$data);
  39. }
  40. /**
  41. * 修改状态为 已退款
  42. * @param $data
  43. * $data array type 1 直接退款 2 退款后返回原状态 refund_price 退款金额
  44. * @param $oid
  45. * $oid string store_order表中的id
  46. */
  47. public static function storeProductOrderRefundYAfter($data,$oid){
  48. StoreOrder::refundTemplate($data,$oid);
  49. }
  50. /**
  51. * 修改状态为 不退款
  52. * @param $data
  53. * $data string 退款原因
  54. * @param $oid
  55. * $oid string store_order表中的id
  56. */
  57. public static function storeProductOrderRefundNAfter($data,$oid){
  58. }
  59. /**
  60. * 线下付款
  61. * @param $id
  62. * $id 订单id
  63. */
  64. public static function storeProductOrderOffline($id){
  65. }
  66. /**
  67. * 修改订单状态
  68. * @param $data
  69. * data total_price 商品总价 pay_price 实际支付
  70. * @param $oid
  71. * oid 订单id
  72. */
  73. public static function storeProductOrderEditAfter($data,$oid){
  74. }
  75. /**
  76. * 修改送货信息
  77. * @param $data
  78. * $data array 送货人姓名/快递公司 送货人电话/快递单号
  79. * @param $oid
  80. * $oid string store_order表中的id
  81. */
  82. public static function storeProductOrderDistributionAfter($data,$oid){
  83. }
  84. /**
  85. * 用户申请退款
  86. * @param $oid
  87. * @param $uid
  88. */
  89. public static function storeProductOrderApplyRefundAfter($oid, $uid)
  90. {
  91. $order = StoreOrder::where('id',$oid)->find();
  92. WechatTemplateService::sendAdminNoticeTemplate([
  93. 'first'=>"亲,您有一个订单申请退款 \n订单号:{$order['order_id']}",
  94. 'keyword1'=>'申请退款',
  95. 'keyword2'=>'待处理',
  96. 'keyword3'=>date('Y/m/d H:i',time()),
  97. 'remark'=>'请及时处理'
  98. ]);
  99. }
  100. /**
  101. * 评价产品
  102. * @param $replyInfo
  103. * @param $cartInfo
  104. */
  105. public static function storeProductOrderReply($replyInfo, $cartInfo)
  106. {
  107. //StoreOrder::checkOrderOver($cartInfo['oid']);
  108. }
  109. /**
  110. * 退积分
  111. * @param $product
  112. * $product 商品信息
  113. * @param $back_integral
  114. * $back_integral 退多少积分
  115. */
  116. public static function storeOrderIntegralBack($product,$back_integral){
  117. }
  118. }