uid = $uid; $this->user = $user; $this->type = $type; $this->amount = $amount; $this->date = $date; } public function handle() { $configRepo = make(ConfigRepoistory::class); $tgMsgServer = $configRepo->get('tg_msg_server', 'sys'); $tgApiToken = $configRepo->get('tg_api_token', 'sys'); if ($tgMsgServer && $tgApiToken) { $type = '未知'; if ($this->type == 1) { $type = '银行卡'; } elseif ($this->type == 2) { $type = 'USDT'; } elseif ($this->type == 3) { $type = '支付宝'; } $commonService = new Client(); $commonService->request( 'POST', $tgMsgServer . 'api/tg/send/withdraw/message', [ 'json' => [ 'uid' => $this->uid, 'user' => $this->user, 'type_name' => $type, 'amount' => $this->amount, 'date' => $this->date, ], 'headers' => ['AUTH-TOKEN' => $tgApiToken] ], ); } } }