初始上传
This commit is contained in:
25
addon/niusms/event/CloseSmsPayment.php
Executable file
25
addon/niusms/event/CloseSmsPayment.php
Executable file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* NiuShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
*/
|
||||
|
||||
namespace addon\niusms\event;
|
||||
|
||||
use addon\niusms\model\Order;
|
||||
|
||||
/**
|
||||
* 关闭短信充值订单
|
||||
*/
|
||||
class CloseSmsPayment
|
||||
{
|
||||
public function handle($param)
|
||||
{
|
||||
$order = new Order();
|
||||
$res = $order->cronCloseSmsPayment($param[ 'relate_id' ]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
32
addon/niusms/event/DoEditSmsMessage.php
Executable file
32
addon/niusms/event/DoEditSmsMessage.php
Executable file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NiuShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
*/
|
||||
|
||||
namespace addon\niusms\event;
|
||||
|
||||
use addon\niusms\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" => "niusms://shop/message/edit", "shop_url" => "niusms://shop/message/edit" ];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
36
addon/niusms/event/EnableCallBack.php
Executable file
36
addon/niusms/event/EnableCallBack.php
Executable file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* NiuShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
*/
|
||||
|
||||
namespace addon\niusms\event;
|
||||
|
||||
use addon\niusms\model\Config;
|
||||
|
||||
/**
|
||||
* 使用这个短信,就要关闭其他短信插件
|
||||
*/
|
||||
class EnableCallBack
|
||||
{
|
||||
/**
|
||||
* 短信发送方式方式及配置
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
if ($param[ 'sms_type' ] != 'niusms') {
|
||||
$param[ 'is_use' ] = 0;
|
||||
$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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
37
addon/niusms/event/EnableSms.php
Executable file
37
addon/niusms/event/EnableSms.php
Executable file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* NiuShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
*/
|
||||
|
||||
namespace addon\niusms\event;
|
||||
|
||||
use addon\niusms\model\Config;
|
||||
|
||||
/**
|
||||
* 查询启用的短信插件
|
||||
*/
|
||||
class EnableSms
|
||||
{
|
||||
/**
|
||||
* 短信发送方式方式及配置
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
$info = array (
|
||||
"sms_type" => "niusms",
|
||||
"sms_type_name" => "牛云短信",
|
||||
"shop_url" => "niusms://shop/sms/index",
|
||||
"desc" => "专业化系统化短信,与商城系统紧密相连,不需要专门配置短信模板即可使用。"
|
||||
);
|
||||
|
||||
$config_model = new Config();
|
||||
$config = $config_model->getSmsConfig($param[ 'site_id' ]);
|
||||
if ($config[ 'data' ][ 'is_use' ] == 1) {
|
||||
return $info;
|
||||
}
|
||||
}
|
||||
}
|
||||
25
addon/niusms/event/Install.php
Executable file
25
addon/niusms/event/Install.php
Executable file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* NiuShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\niusms\event;
|
||||
|
||||
/**
|
||||
* 应用安装
|
||||
*/
|
||||
class Install
|
||||
{
|
||||
/**
|
||||
* 执行安装
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return success();
|
||||
}
|
||||
}
|
||||
32
addon/niusms/event/SendSms.php
Executable file
32
addon/niusms/event/SendSms.php
Executable file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NiuShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\niusms\event;
|
||||
|
||||
use addon\niusms\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;
|
||||
}
|
||||
}
|
||||
31
addon/niusms/event/SmsTemplateInfo.php
Executable file
31
addon/niusms/event/SmsTemplateInfo.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* NiuShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
*/
|
||||
|
||||
namespace addon\niusms\event;
|
||||
|
||||
use addon\niusms\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('sms_template')->getInfo([ ['keywords', '=', $param['keywords'] ]]);
|
||||
return $template_info;
|
||||
}
|
||||
}
|
||||
}
|
||||
36
addon/niusms/event/SmsType.php
Executable file
36
addon/niusms/event/SmsType.php
Executable file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* NiuShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
*/
|
||||
|
||||
namespace addon\niusms\event;
|
||||
|
||||
use addon\niusms\model\Config;
|
||||
|
||||
/**
|
||||
* 短信方式 (后台调用)
|
||||
*/
|
||||
class SmsType
|
||||
{
|
||||
/**
|
||||
* 短信发送方式方式及配置
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
$info = array (
|
||||
"sms_type" => "niusms",
|
||||
"sms_type_name" => "牛云短信",
|
||||
"shop_url" => "niusms://shop/sms/index",
|
||||
"desc" => "专业化系统化短信,与商城系统紧密相连,不需要专门配置短信模板即可使用。"
|
||||
);
|
||||
|
||||
$config_model = new Config();
|
||||
$config = $config_model->getSmsConfig($param[ 'site_id' ]);
|
||||
$info[ 'status' ] = $config[ 'data' ][ 'is_use' ] ?? 0;
|
||||
return $info;
|
||||
}
|
||||
}
|
||||
25
addon/niusms/event/UnInstall.php
Executable file
25
addon/niusms/event/UnInstall.php
Executable file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* NiuShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\niusms\event;
|
||||
|
||||
/**
|
||||
* 应用卸载
|
||||
*/
|
||||
class UnInstall
|
||||
{
|
||||
/**
|
||||
* 执行卸载
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return success();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user