WorkClientJob.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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\work;
  12. use app\services\work\WorkClientServices;
  13. use crmeb\basic\BaseJobs;
  14. use crmeb\traits\QueueTrait;
  15. /**
  16. * 同步客户
  17. * Class WorkClientJob
  18. * @package app\jobs\work
  19. */
  20. class WorkClientJob extends BaseJobs
  21. {
  22. use QueueTrait;
  23. /**
  24. * @param $page
  25. * @param $cursor
  26. * @return bool
  27. */
  28. public function authClient($page, $cursor)
  29. {
  30. /** @var WorkClientServices $make */
  31. $make = app()->make(WorkClientServices::class);
  32. $make->authGetExternalcontact($page, $cursor);
  33. return true;
  34. }
  35. /**
  36. * 同步客户信息
  37. * @param $corpId
  38. * @param $externalUserID
  39. * @param $userId
  40. */
  41. public function saveClientInfo($corpId, $externalUserID, $userId)
  42. {
  43. /** @var WorkClientServices $make */
  44. $make = app()->make(WorkClientServices::class);
  45. $make->saveOrUpdateClient($corpId, $externalUserID, $userId);
  46. return true;
  47. }
  48. /**
  49. * 设置客户标签
  50. * @param $markTag
  51. * @return bool
  52. */
  53. public function setLabel($markTag)
  54. {
  55. /** @var WorkClientServices $make */
  56. $make = app()->make(WorkClientServices::class);
  57. $make->setClientMarkTag($markTag);
  58. return true;
  59. }
  60. }