regionId($alisms['regionid']) ->asDefaultClient(); try { $result = AlibabaCloud::rpc() ->product($alisms['product']) // ->scheme('https') // https | http ->version('2017-05-25') ->action('SendSms') ->method('POST') ->host($alisms['host']) ->options([ 'query' => [ 'RegionId' => $alisms['regionid'], 'PhoneNumbers' => $phone, 'SignName' => $signName, 'TemplateCode' => $template, 'TemplateParam' => $templateParams, ], ]) ->request(); return $result->toArray(); } catch (ClientException $e) { $this->log->event('alisms', ['alisms_error_ClientException' => $e->getErrorMessage()]); return false; } catch (ServerException $e) { $this->log->event('alisms', ['alisms_error_ServerException' => $e->getErrorMessage()]); return false; } } public function sendForCommunityFinancial($userId, $money) { $csInfo = CsInfo::query()->where(['user_id' => $userId])->first(); $market = Market::query()->where(['id' => $csInfo->market_id])->first(); $params = ['user_name' => $csInfo->name, 'market_name' => $market->name, 'money' => $money]; return $this->send($csInfo->phone, self::TEMPLATE_COMMUNITY_FINANCIAL, json_encode($params)); } }