فهرست منبع

feat: EK-744: 会员注册成功后,增加发送短信功能.

kevinElken 9 ماه پیش
والد
کامیت
45e591314a
2فایلهای تغییر یافته به همراه10 افزوده شده و 1 حذف شده
  1. 1 1
      common/helpers/Sms.php
  2. 9 0
      console/controllers/ToolController.php

+ 1 - 1
common/helpers/Sms.php

@@ -18,7 +18,7 @@ class Sms
      * @return bool
      * @throws \Exception
      */
-    public function sendSMS(string $mobile, string $message, string $userId, string $countryId, string $classify): bool
+    public static function sendSMS(string $mobile, string $message, string $userId, string $countryId, string $classify): bool
     {
         return (new EknotifierSmsDriver)->send($mobile, $message, $userId, $countryId, $classify);
     }

+ 9 - 0
console/controllers/ToolController.php

@@ -13,6 +13,7 @@ use common\helpers\Cache;
 use common\helpers\Date;
 use common\helpers\Email;
 use common\helpers\LoggerTool;
+use common\helpers\Sms;
 use common\helpers\Tool;
 use common\helpers\user\Balance;
 use common\models\CalcBonusBS;
@@ -208,6 +209,14 @@ class ToolController extends BaseController
         Email::sendRegistrationEmail('18511880790@163.com', 'zhangl', 'test123');
     }
 
+    /**
+     * @throws \Exception
+     */
+    public function actionSendSms()
+    {
+        Sms::sendSMS('18511880790', 'welcome Elken!', '123123', '620699181451059200', Sms::welcomePack);
+    }
+
     public function actionUpdatePercent() {
         $percent = 100;
         $periodNum = 134;