* +---------------------------------------------------------------------- */ namespace App\Task\message; use crmeb\utils\MessageType; use Hhxsv5\LaravelS\Swoole\Task\Task; use Illuminate\Support\Facades\Log; /** * 邀请用户完善信息提醒. */ class PerfectInfoRemind extends Task { public function __construct(protected $userInfo, protected $entInfo) {} public function handle() { try { $task = new MessageSendTask( entid: $this->entInfo['id'], i: $this->entInfo['id'], type: MessageType::PERFECT_USER_INFO, toUid: ['to_uid' => $this->userInfo['uid'], 'phone' => $this->userInfo['phone']], params: [ '企业名称' => $this->entInfo['enterprise_name'] ?? '', ], other: ['entid' => $this->entInfo['id'], 'uid' => $this->userInfo['id']] ); Task::deliver($task); } catch (\Throwable $e) { Log::error(__CLASS__ . ':' . $e->getMessage(), ['file' => $e->getFile(), 'line' => $e->getLine(), 'trace' => $e->getTrace()]); } } }