MessageEvent.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. *
  5. * User: king/QQ:995265288
  6. * Date: 2018/3/22 下午5:36
  7. * Email: livsyitian@163.com
  8. */
  9. namespace app\common\events;
  10. class MessageEvent extends Event
  11. {
  12. /**
  13. * 会员ID,需要发送消息的会员ID
  14. *
  15. * @var int
  16. */
  17. public $member_id;
  18. /**
  19. * 消息模版ID
  20. *
  21. * @var int
  22. */
  23. public $template_id;
  24. /**
  25. * 消息参数,需要替换的参数、对应参数值
  26. *
  27. * @var array
  28. */
  29. public $params;
  30. /**
  31. * 消息链接,消息跳转链接
  32. *
  33. * @var string
  34. */
  35. public $url;
  36. /**
  37. * 公众号ID (队列执行,需要记录公众号 ID)
  38. *
  39. * @var int
  40. */
  41. public $uniacid;
  42. public function __construct($member_id, $template_id, array $params, $url='')
  43. {
  44. $this->template_id = $template_id;
  45. $this->member_id = $member_id;
  46. $this->params = $params;
  47. $this->url = $url;
  48. $this->uniacid = \YunShop::app()->uniacid;
  49. }
  50. }