AutoSmsCodeJob.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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\system;
  12. use crmeb\basic\BaseJobs;
  13. use app\services\message\sms\SmsRecordServices;
  14. use crmeb\traits\QueueTrait;
  15. use think\facade\Log;
  16. /**
  17. * 自动更新短信状态
  18. * Class AutoSmsCodeJob
  19. * @package app\jobs\user
  20. */
  21. class AutoSmsCodeJob extends BaseJobs
  22. {
  23. use QueueTrait;
  24. /**
  25. * @return string
  26. */
  27. protected static function queueName()
  28. {
  29. return 'CRMEB_PRO_TASK';
  30. }
  31. /**
  32. * @param $event
  33. */
  34. public function doJob()
  35. {
  36. //清除昨日海报
  37. try {
  38. //修改短信发送记录短信状态
  39. $smsRecord = app()->make(SmsRecordServices::class);
  40. return $smsRecord->modifyResultCode();
  41. } catch (\Throwable $e) {
  42. Log::error('自动更新短信状态:[' . class_basename($this) . ']' . $e->getMessage());
  43. }
  44. }
  45. }