SyncUserCountContentListen.php 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace crmeb\listens;
  12. use app\common\repositories\user\UserRepository;
  13. use crmeb\interfaces\ListenerInterface;
  14. use crmeb\jobs\SyncQueueStatusJob;
  15. use crmeb\services\TimerService;
  16. use crmeb\services\YunxinSmsService;
  17. use Swoole\Timer;
  18. use think\facade\Queue;
  19. class SyncUserCountContentListen extends TimerService implements ListenerInterface
  20. {
  21. public function handle($event): void
  22. {
  23. $this->tick(1000 * 60 * 60 * 4, function () {
  24. app()->make(UserRepository::class)->syncUserCountContent();
  25. });
  26. }
  27. }