[更新]修改短信服务库

This commit is contained in:
Anyon 2019-09-18 09:30:19 +08:00
parent 65d98b6ed7
commit 6ba8d643db
3 changed files with 6 additions and 6 deletions

View File

@ -37,7 +37,7 @@ class Config extends Controller
{ {
$this->title = '商城参数配置'; $this->title = '商城参数配置';
$this->applyCsrfToken('save'); $this->applyCsrfToken('save');
$this->query = ExtendService::querySmsBalance(); $this->query = ExtendService::queryChinaSmsBalance();
$this->query2 = ExtendService::querySmsBalance2(); $this->query2 = ExtendService::querySmsBalance2();
$this->fetch(); $this->fetch();
} }

View File

@ -81,7 +81,7 @@ class Center extends Member
$this->error('获取短信模板失败,联系管理员配置!'); $this->error('获取短信模板失败,联系管理员配置!');
} }
$cache = cache($cachekey); $cache = cache($cachekey);
if (ExtendService::sendSms($this->mid, $phone, str_replace('{code}', $code, $content))) { if (ExtendService::sendChinaSms($this->mid, $phone, str_replace('{code}', $code, $content))) {
$dtime = ($cache['time'] + 120 < time()) ? 0 : (120 - time() + $cache['time']); $dtime = ($cache['time'] + 120 < time()) ? 0 : (120 - time() + $cache['time']);
$this->success('短信验证码发送成功!', ['time' => $dtime]); $this->success('短信验证码发送成功!', ['time' => $dtime]);
} else { } else {

View File

@ -41,7 +41,7 @@ class ExtendService
{ {
/** /**
* 发送短信验证码 * 发送国内短信验证码
* @param string $mid 会员ID * @param string $mid 会员ID
* @param string $phone 手机号 * @param string $phone 手机号
* @param string $content 短信内容 * @param string $content 短信内容
@ -50,7 +50,7 @@ class ExtendService
* @throws \think\Exception * @throws \think\Exception
* @throws \think\exception\PDOException * @throws \think\exception\PDOException
*/ */
public static function sendSms($mid, $phone, $content, $productid = '676767') public static function sendChinaSms($mid, $phone, $content, $productid = '676767')
{ {
$tkey = date("YmdHis"); $tkey = date("YmdHis");
$data = [ $data = [
@ -68,12 +68,12 @@ class ExtendService
} }
/** /**
* 查询短信余额 * 查询国内短信余额
* @return array * @return array
* @throws \think\Exception * @throws \think\Exception
* @throws \think\exception\PDOException * @throws \think\exception\PDOException
*/ */
public static function querySmsBalance() public static function queryChinaSmsBalance()
{ {
$tkey = date("YmdHis"); $tkey = date("YmdHis");
$data = [ $data = [