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