初始上传
This commit is contained in:
34
addon/alisms/event/DoEditSmsMessage.php
Executable file
34
addon/alisms/event/DoEditSmsMessage.php
Executable file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\alisms\event;
|
||||
|
||||
use addon\alisms\model\Config as ConfigModel;
|
||||
|
||||
/**
|
||||
* 短信模板 (后台调用)
|
||||
*/
|
||||
class DoEditSmsMessage
|
||||
{
|
||||
/**
|
||||
* 短信发送方式方式及配置
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$config_model = new ConfigModel();
|
||||
$config_result = $config_model->getSmsConfig();
|
||||
$config = $config_result["data"];
|
||||
if ($config["is_use"] == 1) {
|
||||
return ["edit_url" => "alisms://shop/message/edit", "shop_url" => "alisms://shop/message/edit"];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
37
addon/alisms/event/EnableCallBack.php
Executable file
37
addon/alisms/event/EnableCallBack.php
Executable file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\alisms\event;
|
||||
|
||||
use addon\alisms\model\Config;
|
||||
|
||||
/**
|
||||
* 使用这个短信,就要关闭其他短信插件
|
||||
*/
|
||||
class EnableCallBack
|
||||
{
|
||||
/**
|
||||
* 短信发送方式方式及配置
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
if ($param[ 'sms_type' ] != 'alisms') {
|
||||
$config_model = new Config();
|
||||
$sms_config = $config_model->getSmsConfig($param[ 'site_id' ]);
|
||||
$is_use = $sms_config[ 'data' ][ 'is_use' ];
|
||||
if ($is_use) {
|
||||
$is_use = 0;
|
||||
$res = $config_model->enableCallBack($is_use, $param[ 'site_id' ]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
40
addon/alisms/event/EnableSms.php
Executable file
40
addon/alisms/event/EnableSms.php
Executable file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\alisms\event;
|
||||
|
||||
use addon\alisms\model\Config;
|
||||
|
||||
/**
|
||||
* 查询启用的短信插件
|
||||
*/
|
||||
class EnableSms
|
||||
{
|
||||
/**
|
||||
* 短信发送方式方式及配置
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
$info = array (
|
||||
"sms_type" => "alisms",
|
||||
"sms_type_name" => "阿里云短信",
|
||||
"edit_url" => "alisms://shop/sms/config",
|
||||
"shop_url" => "alisms://shop/sms/config",
|
||||
"desc" => "阿里云短信服务(Short Message Service)支持国内和国际快速发送验证码、短信通知和推广短信,服务范围覆盖全球200多个国家和地区。国内短信支持三网合一专属通道,与工信部携号转网平台实时互联。电信级运维保障,实时监控自动切换,到达率高达99%。"
|
||||
);
|
||||
|
||||
$config_model = new Config();
|
||||
$config = $config_model->getSmsConfig($param[ 'site_id' ]);
|
||||
if ($config[ 'data' ][ 'is_use' ] == 1) {
|
||||
return $info;
|
||||
}
|
||||
}
|
||||
}
|
||||
26
addon/alisms/event/Install.php
Executable file
26
addon/alisms/event/Install.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\alisms\event;
|
||||
|
||||
/**
|
||||
* 应用安装
|
||||
*/
|
||||
class Install
|
||||
{
|
||||
/**
|
||||
* 执行安装
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return success();
|
||||
}
|
||||
}
|
||||
34
addon/alisms/event/SendSms.php
Executable file
34
addon/alisms/event/SendSms.php
Executable file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\alisms\event;
|
||||
|
||||
use addon\alisms\model\Sms;
|
||||
|
||||
/**
|
||||
* 短信发送
|
||||
*/
|
||||
class SendSms
|
||||
{
|
||||
/**
|
||||
* 短信发送方式方式及配置
|
||||
* @param $param
|
||||
* @return array|mixed
|
||||
* @throws \Overtrue\EasySms\Exceptions\InvalidArgumentException
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
$sms = new Sms();
|
||||
$res = $sms->send($param);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
35
addon/alisms/event/SmsTemplateInfo.php
Executable file
35
addon/alisms/event/SmsTemplateInfo.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\alisms\event;
|
||||
|
||||
use addon\alisms\model\Config;
|
||||
|
||||
/**
|
||||
* 获取短信模板数据
|
||||
*/
|
||||
class SmsTemplateInfo
|
||||
{
|
||||
/**
|
||||
* 获取短信模板数据
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
$config_model = new Config();
|
||||
$sms_config = $config_model->getSmsConfig($param['site_id'], 'shop')[ 'data' ];
|
||||
if ($sms_config['is_use']) {
|
||||
$template_info = model('message_template')->getInfo([ ['keywords', '=', $param['keywords'] ]]);
|
||||
if (!empty($template_info['sms_json'])) {
|
||||
return json_decode($template_info['sms_json'], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
38
addon/alisms/event/SmsType.php
Executable file
38
addon/alisms/event/SmsType.php
Executable file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\alisms\event;
|
||||
|
||||
use addon\alisms\model\Config;
|
||||
|
||||
/**
|
||||
* 短信方式 (后台调用)
|
||||
*/
|
||||
class SmsType
|
||||
{
|
||||
/**
|
||||
* 短信发送方式方式及配置
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
$info = array (
|
||||
"sms_type" => "alisms",
|
||||
"sms_type_name" => "阿里云短信",
|
||||
"edit_url" => "alisms://shop/sms/config",
|
||||
"shop_url" => "alisms://shop/sms/config",
|
||||
"desc" => "阿里云短信服务(Short Message Service)支持国内和国际快速发送验证码、短信通知和推广短信,服务范围覆盖全球200多个国家和地区。国内短信支持三网合一专属通道,与工信部携号转网平台实时互联。电信级运维保障,实时监控自动切换,到达率高达99%。"
|
||||
);
|
||||
|
||||
$config_model = new Config();
|
||||
$config = $config_model->getSmsConfig($param[ 'site_id' ]);
|
||||
$info[ 'status' ] = $config[ 'data' ][ 'is_use' ] ?? 0;
|
||||
return $info;
|
||||
}
|
||||
}
|
||||
27
addon/alisms/event/UnInstall.php
Executable file
27
addon/alisms/event/UnInstall.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\alisms\event;
|
||||
|
||||
/**
|
||||
* 应用卸载
|
||||
*/
|
||||
class UnInstall
|
||||
{
|
||||
/**
|
||||
* 执行卸载
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return success();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user