|
|
@@ -1,25 +1,20 @@
|
|
|
<?php
|
|
|
namespace common\helpers;
|
|
|
|
|
|
-use common\components\EknotifierSmsDriver;
|
|
|
+use Yii;
|
|
|
|
|
|
class Sms
|
|
|
{
|
|
|
- const welcomePack = 'welcomePack';
|
|
|
-
|
|
|
- /**
|
|
|
- * Send the SMS.
|
|
|
- *
|
|
|
- * @param string $mobile
|
|
|
- * @param string $message
|
|
|
- * @param string $userId
|
|
|
- * @param string $countryId
|
|
|
- * @param string $classify
|
|
|
- * @return bool
|
|
|
- * @throws \Exception
|
|
|
- */
|
|
|
- public static function sendSMS(string $mobile, string $message, string $userId, string $countryId, string $classify): bool
|
|
|
+ public static function sendSMS($mobile, $message)
|
|
|
{
|
|
|
- return (new EknotifierSmsDriver)->send($mobile, $message, $userId, $countryId, $classify);
|
|
|
+ $mobile = '8618511880790';
|
|
|
+ $message = 'Elken hello AE!';
|
|
|
+
|
|
|
+ $silverStreet = Yii::$app->silverStreet;
|
|
|
+ if ($silverStreet->sendSms($mobile, $message)) {
|
|
|
+ echo '短信发送成功';
|
|
|
+ } else {
|
|
|
+ echo '短信发送失败';
|
|
|
+ }
|
|
|
}
|
|
|
}
|