UserLabelJob.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\jobs\user;
  12. use app\services\user\label\UserLabelServices;
  13. use app\services\work\WorkGroupChatAuthServices;
  14. use crmeb\basic\BaseJobs;
  15. use crmeb\traits\QueueTrait;
  16. /**
  17. * 用户标签
  18. * Class UserLabelJob
  19. * @package app\jobs\user
  20. */
  21. class UserLabelJob extends BaseJobs
  22. {
  23. use QueueTrait;
  24. /**
  25. * 同步后台标签到企业微信客户后台
  26. * @param $cateId
  27. * @param $groupName
  28. * @return bool
  29. */
  30. public function authLabel($cateId, $groupName)
  31. {
  32. /** @var UserLabelServices $make */
  33. $make = app()->make(UserLabelServices::class);
  34. return $make->addCorpClientLabel($cateId, $groupName);
  35. }
  36. /**
  37. * 同步企业微信客户标签到平台
  38. * @return bool
  39. */
  40. public function authWorkLabel()
  41. {
  42. /** @var UserLabelServices $make */
  43. $make = app()->make(UserLabelServices::class);
  44. return $make->authWorkLabel();
  45. }
  46. /**
  47. * 编辑客户标签
  48. * @param $userid
  49. * @param $groupAuthId
  50. * @return mixed
  51. */
  52. public function clientAddLabel($userid, $externalUserID, $groupAuthId)
  53. {
  54. /** @var WorkGroupChatAuthServices $chatAuthService */
  55. $chatAuthService = app()->make(WorkGroupChatAuthServices::class);
  56. return $chatAuthService->clientAddLabel((int)$groupAuthId, $userid, $externalUserID);
  57. }
  58. }