| @@ 33-44 (lines=12) @@ | ||
| 30 | return count($list) === 1 ? array_pop($list) : array_values($list); |
|
| 31 | } |
|
| 32 | ||
| 33 | public function sendContentSms($to, $content) |
|
| 34 | { |
|
| 35 | $params = [ |
|
| 36 | 'type' => 0, // 0:普通短信 1:营销短信 |
|
| 37 | 'msg' => $content, |
|
| 38 | 'tel' => $to, |
|
| 39 | 'time' => time(), |
|
| 40 | ]; |
|
| 41 | $this->random = $this->getRandom(); |
|
| 42 | $sendUrl = "{$this->sendSms}?sdkappid={$this->appId}&random={$this->random}"; |
|
| 43 | $this->request($sendUrl, $params); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function sendTemplateSms($to, $tempId, array $data) |
|
| 47 | { |
|
| @@ 46-57 (lines=12) @@ | ||
| 43 | $this->request($sendUrl, $params); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function sendTemplateSms($to, $tempId, array $data) |
|
| 47 | { |
|
| 48 | $params = [ |
|
| 49 | 'tel' => $to, |
|
| 50 | 'tpl_id' => $tempId, |
|
| 51 | 'params' => array_values($data), |
|
| 52 | 'time' => time(), |
|
| 53 | ]; |
|
| 54 | $this->random = $this->getRandom(); |
|
| 55 | $sendUrl = "{$this->sendSms}?sdkappid={$this->appId}&random={$this->random}"; |
|
| 56 | $this->request($sendUrl, $params); |
|
| 57 | } |
|
| 58 | ||
| 59 | public function sendVoiceCode($to, $code) |
|
| 60 | { |
|