kevinElken 9 месяцев назад
Родитель
Сommit
5ea4a32f7a
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      common/components/SilverStreet.php

+ 5 - 0
common/components/SilverStreet.php

@@ -1,6 +1,7 @@
 <?php
 namespace common\components;
 
+use common\helpers\LoggerTool;
 use yii\base\Component;
 use yii\helpers\Json;
 use yii\httpclient\Client;
@@ -8,6 +9,7 @@ use yii\httpclient\Client;
 class SilverStreet extends Component {
     public $username;
     public $password;
+    public $sender;
     public $apiUrl;
 
     public function sendSms($mobile, $content): bool
@@ -16,10 +18,13 @@ class SilverStreet extends Component {
         $params = [
             'username' => $this->username,
             'password' => $this->password,
+            'sender' => $this->sender,
             'mobile' => $mobile,
             'content' => $content,
         ];
 
+        LoggerTool::info([$params, $this->apiUrl]);
+
         try {
             $response = $client->post($this->apiUrl, $params)->send();
             if ($response->isOk) {