MiniMessageService.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: shenyang
  5. * Date: 2017/6/5
  6. * Time: 下午7:53
  7. */
  8. namespace app\frontend\modules\order\services;
  9. use app\frontend\modules\order\services\message\MiniBuyerMessage;
  10. use app\frontend\modules\order\services\message\MiniShopMessage;
  11. class MiniMessageService extends \app\common\services\MessageService
  12. {
  13. private $buyerMessage;
  14. private $shopMessage;
  15. protected $formId;
  16. protected $noticeType;
  17. function __construct($order,$formId = '',$type = 1,$title = '')
  18. {
  19. $this->buyerMessage = new MiniBuyerMessage($order,$formId,$type,$title);
  20. $this->shopMessage = new MiniShopMessage($order,$formId,$type,$title);
  21. $this->formId = $formId;
  22. $this->noticeType = $type;
  23. }
  24. // public function canceled()
  25. // {
  26. // $this->buyerMessage->canceled();
  27. //
  28. // }
  29. //
  30. // public function created()
  31. // {
  32. // $this->shopMessage->goodsBuy(1);
  33. // $this->buyerMessage->created();
  34. // if (\Setting::get('shop.notice.notice_enable.created')) {
  35. // $this->shopMessage->created();
  36. // }
  37. // }
  38. //
  39. // public function paid()
  40. // {
  41. // $this->shopMessage->goodsBuy(2);
  42. // $this->buyerMessage->paid();
  43. //
  44. // if (\Setting::get('shop.notice.notice_enable.paid')) {
  45. // $this->shopMessage->paid();
  46. // }
  47. //
  48. // }
  49. //
  50. // public function sent()
  51. // {
  52. // $this->buyerMessage->sent();
  53. //
  54. // }
  55. public function refund()
  56. {
  57. $this->buyerMessage->delivery('订单发货提醒');
  58. }
  59. public function canceled()
  60. {
  61. $this->buyerMessage->canceled('订单取消通知');
  62. }
  63. public function received()
  64. {
  65. if ($this->noticeType == 2) {
  66. $this->shopMessage->paymentRemind('订单支付成功提醒');
  67. }
  68. $this->buyerMessage->paymentSuccess('订单支付成功通知');
  69. }
  70. }