MerchantApplyMentsCheckListen.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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\system\merchant\MerchantApplymentsRepository;
  13. use crmeb\services\TimerService;
  14. use Swoole\Timer;
  15. use think\facade\Log;
  16. use crmeb\interfaces\ListenerInterface;
  17. class MerchantApplyMentsCheckListen extends TimerService implements ListenerInterface
  18. {
  19. public function handle($event): void
  20. {
  21. //申请状态: 0.平台未提交,-1.平台驳回,10.平台提交审核中,11.需用户操作 ,20.已完成,30.已冻结,40.驳回
  22. $make = app()->make(MerchantApplymentsRepository::class);
  23. $this->tick(1000 * 60 * 30, function () use($make) {
  24. $ret = $make->getSearch(['is_del' => 0])->where('status','in',[10,11,30])->select();
  25. try {
  26. foreach ($ret as $item) {
  27. $make->check($item['mer_id']);
  28. }
  29. } catch (\Exception $e) {
  30. Log::info('自动查询分账商户审核失败' . date('Y-m-d H:i:s', time()));
  31. }
  32. });
  33. }
  34. }