MerchantApplyMentsCheckListen.php 1.0 KB

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