|
@@ -34,9 +34,8 @@ class Sms
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public function send_msg($mobile, $code, $type, $extime = '5')
|
|
|
|
|
|
+ private function send_msg($mobile, $datas, $type)
|
|
{
|
|
{
|
|
- Log::record("SMS send:{$mobile} {$code} {$type}", Log::DEBUG);
|
|
|
|
$folder = 'yuntx';
|
|
$folder = 'yuntx';
|
|
$plugin = str_replace('\\', '', str_replace('/', '', str_replace('.', '', $folder)));
|
|
$plugin = str_replace('\\', '', str_replace('/', '', str_replace('.', '', $folder)));
|
|
if (!empty($plugin)) {
|
|
if (!empty($plugin)) {
|
|
@@ -44,7 +43,7 @@ class Sms
|
|
require_once(PLUGIN_ROOT . DS . $plugin . DS . 'CCPRestSDK.php');
|
|
require_once(PLUGIN_ROOT . DS . $plugin . DS . 'CCPRestSDK.php');
|
|
require_once(PLUGIN_ROOT . DS . $plugin . DS . 'SendSMS.php');
|
|
require_once(PLUGIN_ROOT . DS . $plugin . DS . 'SendSMS.php');
|
|
|
|
|
|
- return sendSMS($mobile, array($code, $extime), $type);
|
|
|
|
|
|
+ return sendSMS($mobile, $datas, $type);
|
|
} else {
|
|
} else {
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
@@ -64,14 +63,15 @@ class Sms
|
|
*/
|
|
*/
|
|
private function mysend_yuntx($mobile, $content)
|
|
private function mysend_yuntx($mobile, $content)
|
|
{
|
|
{
|
|
- $code = $content['code'];
|
|
|
|
- $time = $content['time'];
|
|
|
|
$type = intval($content['type']);
|
|
$type = intval($content['type']);
|
|
-
|
|
|
|
|
|
+ if(array_key_exists('type',$content)) {
|
|
|
|
+ unset($content['type']);
|
|
|
|
+ }
|
|
|
|
+
|
|
static $templates = array(self::register_code => '59006', self::resetpass_code => '63477', self::getbonus_code => '63479', self::getbind_code => '59006');
|
|
static $templates = array(self::register_code => '59006', self::resetpass_code => '63477', self::getbonus_code => '63479', self::getbind_code => '59006');
|
|
if (!array_key_exists($type, $templates)) return -1;
|
|
if (!array_key_exists($type, $templates)) return -1;
|
|
|
|
|
|
- return $this->send_msg($mobile, $code, $templates[$type], $time);
|
|
|
|
|
|
+ return $this->send_msg($mobile, $content, $templates[$type]);
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -186,6 +186,4 @@ class Sms
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|