初始上传
This commit is contained in:
27
addon/divideticket/event/CloseDivideticket.php
Executable file
27
addon/divideticket/event/CloseDivideticket.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\divideticket\event;
|
||||
|
||||
|
||||
/**
|
||||
* 关闭活动
|
||||
*/
|
||||
class CloseDivideticket
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
27
addon/divideticket/event/CronChangeDivideticketStatus.php
Executable file
27
addon/divideticket/event/CronChangeDivideticketStatus.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\divideticket\event;
|
||||
|
||||
use addon\divideticket\model\Divideticket;
|
||||
|
||||
/**
|
||||
* 修改活动状态
|
||||
*/
|
||||
class CronChangeDivideticketStatus
|
||||
{
|
||||
|
||||
public function handle($params = [])
|
||||
{
|
||||
$coupon = new Divideticket();
|
||||
$res = $coupon->changeDivideticketStatus($params[ 'relate_id' ]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
28
addon/divideticket/event/DivideticketLaunchClose.php
Executable file
28
addon/divideticket/event/DivideticketLaunchClose.php
Executable file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\divideticket\event;
|
||||
|
||||
use addon\divideticket\model\DivideticketFriendsGroup;
|
||||
|
||||
/**
|
||||
* 关闭瓜分活动
|
||||
* Class DivideticketLaunchClose
|
||||
* @package addon\divideticket\event
|
||||
*/
|
||||
class DivideticketLaunchClose
|
||||
{
|
||||
public function handle($params)
|
||||
{
|
||||
$divideticket_friends_group = new DivideticketFriendsGroup();
|
||||
$res = $divideticket_friends_group->cronCloseDivideticketLaunchLaunch($params['relate_id']);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
28
addon/divideticket/event/DivideticketSimulation.php
Executable file
28
addon/divideticket/event/DivideticketSimulation.php
Executable file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\divideticket\event;
|
||||
|
||||
use addon\divideticket\model\Divideticket;
|
||||
|
||||
/**
|
||||
* 关闭瓜分活动
|
||||
* Class DivideticketLaunchClose
|
||||
* @package addon\divideticket\event
|
||||
*/
|
||||
class DivideticketSimulation
|
||||
{
|
||||
public function handle($params)
|
||||
{
|
||||
$divideticket = new Divideticket();
|
||||
$res = $divideticket->cronDivideticketSimulation($params['relate_id']);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
26
addon/divideticket/event/Install.php
Executable file
26
addon/divideticket/event/Install.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\divideticket\event;
|
||||
|
||||
/**
|
||||
* 应用安装
|
||||
*/
|
||||
class Install
|
||||
{
|
||||
/**
|
||||
* 执行安装
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return success();
|
||||
}
|
||||
}
|
||||
26
addon/divideticket/event/OpenDivideticket.php
Executable file
26
addon/divideticket/event/OpenDivideticket.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\divideticket\event;
|
||||
|
||||
/**
|
||||
* 开启活动
|
||||
*/
|
||||
class OpenDivideticket
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
95
addon/divideticket/event/ShowPromotion.php
Executable file
95
addon/divideticket/event/ShowPromotion.php
Executable file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\divideticket\event;
|
||||
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
*/
|
||||
class ShowPromotion
|
||||
{
|
||||
public $promotion_type = 'time_limit';
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function handle($params = [])
|
||||
{
|
||||
$data = [
|
||||
'shop' => [
|
||||
[
|
||||
//插件名称
|
||||
'name' => 'divideticket',
|
||||
//展示分类(根据平台端设置,admin(平台营销),shop:店铺营销,member:会员营销, tool:应用工具)
|
||||
'show_type' => 'member',
|
||||
//展示主题
|
||||
'title' => '好友瓜分券',
|
||||
//展示介绍
|
||||
'description' => '帮助商家提升客单价',
|
||||
//展示图标
|
||||
'icon' => 'addon/divideticket/icon.png',
|
||||
//跳转链接
|
||||
'url' => 'divideticket://shop/divideticket/lists',
|
||||
'summary' => $this->summary($params)
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 营销活动概况
|
||||
* @param $params
|
||||
* @return array
|
||||
*/
|
||||
private function summary($params)
|
||||
{
|
||||
if (empty($params)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if(isset($params['promotion_type']) && $params['promotion_type'] != $this->promotion_type){
|
||||
return [];
|
||||
}
|
||||
|
||||
//获取活动数量
|
||||
if (isset($params[ 'count' ])) {
|
||||
$count = model("promotion_friends_coupon")->getCount();
|
||||
return [
|
||||
'count' => $count
|
||||
];
|
||||
}
|
||||
//获取活动概况,需要获取开始时间与结束时间
|
||||
if (isset($params[ 'summary' ])) {
|
||||
$list = model("promotion_friends_coupon")->getList([
|
||||
[ '', 'exp', Db::raw('not ( (`start_time` >= ' . $params[ 'end_time' ] . ') or (`end_time` <= ' . $params[ 'start_time' ] . '))') ],
|
||||
[ 'site_id', '=', $params[ 'site_id' ] ],
|
||||
[ 'status', '<>', 2 ],
|
||||
[ 'status', '<>', -1 ]
|
||||
], 'name as promotion_name,coupon_id as promotion_id,start_time,end_time');
|
||||
return !empty($list) ? [
|
||||
'time_limit' => [
|
||||
'count' => count($list),
|
||||
'detail' => $list,
|
||||
'color' => '#7BE295'
|
||||
]
|
||||
] : [];
|
||||
}
|
||||
}
|
||||
}
|
||||
26
addon/divideticket/event/UnInstall.php
Executable file
26
addon/divideticket/event/UnInstall.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\divideticket\event;
|
||||
|
||||
/**
|
||||
* 应用卸载
|
||||
*/
|
||||
class UnInstall
|
||||
{
|
||||
/**
|
||||
* 执行卸载
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return error("系统插件不能删除");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user