WorkMemberJob.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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\WorkMemberServices;
  13. use crmeb\basic\BaseJobs;
  14. use crmeb\traits\QueueTrait;
  15. /**
  16. * 企业微信成员
  17. * Class WorkMemberJob
  18. * @package app\jobs\work
  19. */
  20. class WorkMemberJob extends BaseJobs
  21. {
  22. use QueueTrait;
  23. /**
  24. * 执行部门同步
  25. * @param $id
  26. * @return bool
  27. */
  28. public function run($id)
  29. {
  30. /** @var WorkMemberServices $make */
  31. $make = app()->make(WorkMemberServices::class);
  32. $make->authUpdataMember((int)$id);
  33. return true;
  34. }
  35. /**
  36. * 保存数据
  37. * @param $member
  38. * @return bool
  39. */
  40. public function save($member)
  41. {
  42. /** @var WorkMemberServices $make */
  43. $make = app()->make(WorkMemberServices::class);
  44. return $make->saveMember($member);
  45. }
  46. }