Unsubscribe.php 1.0 KB

1234567891011121314151617181920212223242526272829
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CatchAdmin [Just Like ~ ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
  8. // +----------------------------------------------------------------------
  9. // | Author: JaguarJack [ njphper@gmail.com ]
  10. // +----------------------------------------------------------------------
  11. namespace catchAdmin\wechat\library\messages\events;
  12. use catchAdmin\wechat\library\messages\Message;
  13. use catchAdmin\wechat\model\WechatUsers;
  14. /**
  15. * 取消订阅事件
  16. *
  17. * Class Unsubscribe
  18. * @package catchAdmin\wechat\library\messages\events
  19. */
  20. class Unsubscribe extends Message
  21. {
  22. public function reply()
  23. {
  24. // TODO: Implement reply() method.
  25. WechatUsers::where('openid', $this->fromUserName())->find()->delete();
  26. }
  27. }