NoticeService.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. namespace App\Services\Complain;
  3. use App\Http\Controllers\Miniprogram\Core;
  4. use App\Models\ComplaintModel;
  5. use App\Models\User\UserModel;
  6. use App\Services\Log\NoticeLogService;
  7. use App\Services\NoticeService\Channels\WeChatTemplateChannel;
  8. use App\Services\QQMiniApp\Template;
  9. use PocketBE\MsyPush\Jobs\RegistEventJob;
  10. class NoticeService
  11. {
  12. /**
  13. * 回复举报者
  14. * @param ComplaintModel $complaint
  15. */
  16. public function reply(ComplaintModel $complaint)
  17. {
  18. $to_uid = $complaint->uid;
  19. $user = UserModel::find($to_uid);
  20. $payload = [
  21. 'to_user' => $user->getAuth(),
  22. 'complaint' => $complaint->toArray(),
  23. 'meta' => [
  24. 'date' => date('Y-m-d'),
  25. ],
  26. ];
  27. dispatch(new RegistEventJob(10501, $payload))->onQueue("{push}");
  28. }
  29. /**
  30. * 拉黑被举报者通知
  31. * @param ComplaintModel $complaint
  32. */
  33. public function defriendNoticeBeuser(ComplaintModel $complaint)
  34. {
  35. $to_uid = $complaint->be_uid;
  36. $user = UserModel::find($to_uid);
  37. $payload = [
  38. 'to_user' => $user->getAuth(),
  39. 'complaint' => $complaint->toArray(),
  40. 'meta' => [
  41. 'date' => date('Y-m-d'),
  42. ],
  43. ];
  44. dispatch(new RegistEventJob(10502, $payload))->onQueue("{push}");
  45. }
  46. /**
  47. * 拉黑通知举报者
  48. * @param ComplaintModel $complaint
  49. */
  50. public function defriendNotice(ComplaintModel $complaint)
  51. {
  52. $to_uid = $complaint->uid;
  53. $user = UserModel::find($to_uid);
  54. $payload = [
  55. 'to_user' => $user->getAuth(),
  56. 'complaint' => $complaint->toArray(),
  57. 'meta' => [
  58. 'date' => date('Y-m-d'),
  59. ],
  60. ];
  61. dispatch(new RegistEventJob(10503, $payload))->onQueue("{push}");
  62. }
  63. /**
  64. * 举报-删除被举报者字段通知
  65. * @param ComplaintModel $complaint
  66. */
  67. public function erasingNotice(ComplaintModel $complaint)
  68. {
  69. $to_uid = $complaint->be_uid;
  70. $user = UserModel::find($to_uid);
  71. $payload = [
  72. 'to_user' => $user->getAuth(),
  73. 'complaint' => $complaint->toArray(),
  74. 'meta' => [
  75. 'date' => date('Y-m-d'),
  76. ],
  77. ];
  78. dispatch(new RegistEventJob(10504, $payload))->onQueue("{push}");
  79. }
  80. }