WorkGroupMsgJob.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace app\jobs\work;
  3. use app\services\work\WorkGroupMsgSendResultServices;
  4. use app\services\work\WorkGroupMsgTaskServices;
  5. use app\services\work\WorkGroupTemplateServices;
  6. use crmeb\basic\BaseJobs;
  7. use crmeb\traits\QueueTrait;
  8. /**
  9. * 企业微信群发任务
  10. * Class WorkGroupMsgJob
  11. * @package app\jobs\work
  12. */
  13. class WorkGroupMsgJob extends BaseJobs
  14. {
  15. use QueueTrait;
  16. /**
  17. * 批量
  18. * @param $id
  19. * @param $userId
  20. * @param $count
  21. * @return bool
  22. */
  23. public function batch($id, $userId, $count)
  24. {
  25. /** @var WorkGroupTemplateServices $service */
  26. $service = app()->make(WorkGroupTemplateServices::class);
  27. return $service->batch((int)$id, $userId, (int)$count);
  28. }
  29. /**
  30. * 获取群发成员发送任务列表
  31. * @param $type
  32. * @param $msgid
  33. * @param $cursor
  34. * @return mixed
  35. */
  36. public function getTaks($type, $msgid, $cursor)
  37. {
  38. /** @var WorkGroupMsgTaskServices $service */
  39. $service = app()->make(WorkGroupMsgTaskServices::class);
  40. return $service->getTaks($type, $msgid, $cursor);
  41. }
  42. /**
  43. * @param $type
  44. * @param $userid
  45. * @param $msgid
  46. * @param $cursor
  47. * @return bool
  48. */
  49. public function getSendResult($type, $userid, $msgid, $cursor)
  50. {
  51. /** @var WorkGroupMsgSendResultServices $service */
  52. $service = app()->make(WorkGroupMsgSendResultServices::class);
  53. return $service->getSendResult($type, $userid, $msgid, $cursor);
  54. }
  55. }