初始上传
This commit is contained in:
35
addon/coupon/event/AddStat.php
Executable file
35
addon/coupon/event/AddStat.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\coupon\event;
|
||||
|
||||
use addon\coupon\model\CouponStat;
|
||||
|
||||
/**
|
||||
* 礼品卡统计
|
||||
*/
|
||||
class AddStat
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
$type = $params['type'];
|
||||
if($type == 'receive_coupon'){
|
||||
$coupon_stat_model = new CouponStat();
|
||||
$res = $coupon_stat_model->addReceiveCouponStat($params['data']);
|
||||
return $res;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
27
addon/coupon/event/CronCouponEnd.php
Executable file
27
addon/coupon/event/CronCouponEnd.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\coupon\event;
|
||||
|
||||
use addon\coupon\model\Coupon;
|
||||
|
||||
/**
|
||||
* 启动活动
|
||||
*/
|
||||
class CronCouponEnd
|
||||
{
|
||||
|
||||
public function handle($params = [])
|
||||
{
|
||||
$coupon = new Coupon();
|
||||
$res = $coupon->cronCouponEnd();
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
27
addon/coupon/event/CronCouponTypeEnd.php
Executable file
27
addon/coupon/event/CronCouponTypeEnd.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\coupon\event;
|
||||
|
||||
use addon\coupon\model\CouponType;
|
||||
|
||||
/**
|
||||
* 优惠券定时结束
|
||||
*/
|
||||
class CronCouponTypeEnd
|
||||
{
|
||||
|
||||
public function handle($params = [])
|
||||
{
|
||||
$coupon = new CouponType();
|
||||
$res = $coupon->couponCronEnd($params[ 'relate_id' ]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
38
addon/coupon/event/Install.php
Executable file
38
addon/coupon/event/Install.php
Executable file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\coupon\event;
|
||||
|
||||
use app\model\system\Cron;
|
||||
|
||||
/**
|
||||
* 应用安装
|
||||
*/
|
||||
class Install
|
||||
{
|
||||
/**
|
||||
* 执行安装
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
try {
|
||||
execute_sql('addon/coupon/data/install.sql');
|
||||
|
||||
$cron = new Cron();
|
||||
$cron->deleteCron([ ['event', '=', 'CronCouponEnd'] ]);
|
||||
$cron->addCron(2, 1, '优惠券过期自动关闭', 'CronCouponEnd', time(), 0);
|
||||
|
||||
return success();
|
||||
} catch (\Exception $e) {
|
||||
return error('', $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
30
addon/coupon/event/PromotionPage.php
Executable file
30
addon/coupon/event/PromotionPage.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\coupon\event;
|
||||
|
||||
/**
|
||||
* 营销活动页面
|
||||
*/
|
||||
class PromotionPage
|
||||
{
|
||||
public function handle($params)
|
||||
{
|
||||
$page_list = [
|
||||
[
|
||||
'name' => 'COUPON_DETAIL',
|
||||
'title' => '优惠券详情',
|
||||
'wap_url' => '/pages_tool/goods/coupon_receive?coupon_type_id=$coupon_type_id',
|
||||
'web_url' => '',
|
||||
],
|
||||
];
|
||||
return $page_list;
|
||||
}
|
||||
}
|
||||
46
addon/coupon/event/ShowPromotion.php
Executable file
46
addon/coupon/event/ShowPromotion.php
Executable file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\coupon\event;
|
||||
|
||||
/**
|
||||
* 店铺活动
|
||||
*/
|
||||
class ShowPromotion
|
||||
{
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
* @return array
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$data = [
|
||||
'shop' => [
|
||||
[
|
||||
//插件名称
|
||||
'name' => 'coupon',
|
||||
//展示分类(根据平台端设置,admin(平台营销),shop:店铺营销,member:会员营销, tool:应用工具)
|
||||
'show_type' => 'shop',
|
||||
//展示主题
|
||||
'title' => '优惠券',
|
||||
//展示介绍
|
||||
'description' => '设置商家优惠券',
|
||||
//展示图标
|
||||
'icon' => 'addon/coupon/icon.png',
|
||||
//跳转链接
|
||||
'url' => 'coupon://shop/coupon/lists',
|
||||
]
|
||||
]
|
||||
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
32
addon/coupon/event/UnInstall.php
Executable file
32
addon/coupon/event/UnInstall.php
Executable file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\coupon\event;
|
||||
|
||||
/**
|
||||
* 应用卸载
|
||||
*/
|
||||
class UnInstall
|
||||
{
|
||||
/**
|
||||
* 执行卸载
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
try {
|
||||
return error('', "系统插件不允许删除");
|
||||
//execute_sql('addon/coupon/data/uninstall.sql');
|
||||
//return success();
|
||||
} catch (\Exception $e) {
|
||||
return error('', $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user