初始上传
This commit is contained in:
31
addon/presale/event/AddonOrderRefund.php
Executable file
31
addon/presale/event/AddonOrderRefund.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\presale\event;
|
||||
|
||||
use addon\presale\model\PresaleOrderRefund;
|
||||
|
||||
/**
|
||||
* 订单退款
|
||||
*/
|
||||
class AddonOrderRefund
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
if ($params[ 'promotion_type' ] == 'presale') {
|
||||
$presale = new PresaleOrderRefund();
|
||||
$res = $presale->refundPresaleOrder($params[ 'order_no' ], $params[ 'is_deposit_back' ], $params[ 'refund_money_type' ]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
}
|
||||
30
addon/presale/event/ClosePresale.php
Executable file
30
addon/presale/event/ClosePresale.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\presale\event;
|
||||
|
||||
use addon\presale\model\Presale;
|
||||
|
||||
/**
|
||||
* 关闭活动
|
||||
*/
|
||||
class ClosePresale
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
$presale = new Presale();
|
||||
$res = $presale->cronClosePresale($params[ 'relate_id' ]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
31
addon/presale/event/CronRefundOrderDepositClose.php
Executable file
31
addon/presale/event/CronRefundOrderDepositClose.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\presale\event;
|
||||
|
||||
use addon\presale\model\PresaleOrderCommon;
|
||||
|
||||
/**
|
||||
* 订单尾款结束自动退款
|
||||
*/
|
||||
class CronRefundOrderDepositClose
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
$presale_order_model = new PresaleOrderCommon();
|
||||
$res = $presale_order_model->cronRefundOrderDepositClose($params[ 'relate_id' ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
}
|
||||
31
addon/presale/event/DepositOrderClose.php
Executable file
31
addon/presale/event/DepositOrderClose.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\presale\event;
|
||||
|
||||
use addon\presale\model\PresaleOrderCommon;
|
||||
|
||||
/**
|
||||
* 定金订单关闭
|
||||
*/
|
||||
class DepositOrderClose
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
$presale_order_model = new PresaleOrderCommon();
|
||||
$res = $presale_order_model->cronDepositOrderClose($params[ 'relate_id' ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
}
|
||||
31
addon/presale/event/DepositOrderPayNotify.php
Executable file
31
addon/presale/event/DepositOrderPayNotify.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\presale\event;
|
||||
|
||||
use addon\presale\model\PresaleOrderCommon;
|
||||
|
||||
/**
|
||||
* 定金支付回调
|
||||
*/
|
||||
class DepositOrderPayNotify
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
$presale_order_model = new PresaleOrderCommon();
|
||||
$res = $presale_order_model->depositOrderOnlinePay($params);
|
||||
return $res;
|
||||
}
|
||||
|
||||
}
|
||||
31
addon/presale/event/FinalOrderPayNotify.php
Executable file
31
addon/presale/event/FinalOrderPayNotify.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\presale\event;
|
||||
|
||||
use addon\presale\model\PresaleOrderCommon;
|
||||
|
||||
/**
|
||||
* 尾款支付回调
|
||||
*/
|
||||
class FinalOrderPayNotify
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
$presale_order_model = new PresaleOrderCommon();
|
||||
$res = $presale_order_model->finalOrderOnlinePay($params);
|
||||
return $res;
|
||||
}
|
||||
|
||||
}
|
||||
42
addon/presale/event/GoodsListCategoryIds.php
Executable file
42
addon/presale/event/GoodsListCategoryIds.php
Executable file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\presale\event;
|
||||
|
||||
use addon\presale\model\Presale;
|
||||
|
||||
/**
|
||||
* 商品分类id
|
||||
*/
|
||||
class GoodsListCategoryIds
|
||||
{
|
||||
|
||||
/**
|
||||
* 商品营销活动信息
|
||||
* @param $param
|
||||
* @return array
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
if (empty($param[ 'promotion' ]) || $param[ 'promotion' ] != 'presale') return [];
|
||||
|
||||
$condition[] = [
|
||||
[ 'pp.site_id', '=', $param[ 'site_id' ] ],
|
||||
[ 'pp.status', '=', 1 ],
|
||||
];
|
||||
|
||||
$model = new Presale();
|
||||
$res = $model->getGoodsCategoryIds($condition);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
59
addon/presale/event/GoodsListPromotion.php
Executable file
59
addon/presale/event/GoodsListPromotion.php
Executable file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\presale\event;
|
||||
|
||||
use addon\presale\model\Presale;
|
||||
|
||||
/**
|
||||
* 商品营销活动信息
|
||||
*/
|
||||
class GoodsListPromotion
|
||||
{
|
||||
|
||||
/**
|
||||
* 商品营销活动信息
|
||||
* @param $param
|
||||
* @return array
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
if (empty($param[ 'promotion' ]) || $param[ 'promotion' ] != 'presale') return [];
|
||||
|
||||
$condition[] = [
|
||||
[ 'pp.site_id', '=', $param[ 'site_id' ] ],
|
||||
[ 'pp.status', '=', 1 ]
|
||||
];
|
||||
if ($param[ 'promotion_name' ]) {
|
||||
$condition[] = [ 'pp.presale_name', 'like', '%' . $param[ 'promotion_name' ] . '%' ];
|
||||
}
|
||||
if (!empty($param[ 'goods_name' ])) {
|
||||
$condition[] = [ 'g.goods_name', 'like', '%' . $param[ 'goods_name' ] . '%' ];
|
||||
}
|
||||
if (!empty($param[ 'select_type' ]) && $param[ 'select_type' ] == 'selected' && isset($param[ 'goods_ids' ])) {
|
||||
$condition[] = [ 'g.goods_id', 'in', $param[ 'goods_ids' ] ];
|
||||
}
|
||||
if (!empty($param[ 'category_id' ])) {
|
||||
$condition[] = [ 'g.category_id', 'like', '%,' . $param[ 'category_id' ] . ',%' ];
|
||||
}
|
||||
if (!empty($param[ 'label_id' ])) {
|
||||
$condition[] = [ 'g.label_id', '=', $param[ 'label_id' ] ];
|
||||
}
|
||||
if (!empty($param[ 'goods_class' ])) {
|
||||
$condition[] = [ 'g.goods_class', '=', $param[ 'goods_class' ] ];
|
||||
}
|
||||
$model = new Presale();
|
||||
$list = $model->getPresaleGoodsPageList($condition, $param[ 'page' ], $param[ 'page_size' ], 'pp.presale_id desc');
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
30
addon/presale/event/GoodsPromotionType.php
Executable file
30
addon/presale/event/GoodsPromotionType.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\presale\event;
|
||||
|
||||
/**
|
||||
* 活动类型
|
||||
*/
|
||||
class GoodsPromotionType
|
||||
{
|
||||
|
||||
/**
|
||||
* 活动类型
|
||||
* @return array
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return [ 'name' => '商品预售', 'short' => '预', 'type' => 'presale', 'color' => '#4CB130', 'url' => 'presale://shop/presale/lists' ];
|
||||
}
|
||||
}
|
||||
26
addon/presale/event/Install.php
Executable file
26
addon/presale/event/Install.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\presale\event;
|
||||
|
||||
/**
|
||||
* 应用安装
|
||||
*/
|
||||
class Install
|
||||
{
|
||||
/**
|
||||
* 执行安装
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return success();
|
||||
}
|
||||
}
|
||||
41
addon/presale/event/IsJoinPresale.php
Executable file
41
addon/presale/event/IsJoinPresale.php
Executable file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\presale\event;
|
||||
|
||||
use addon\presale\model\Presale;
|
||||
|
||||
/**
|
||||
* 是否参与预售
|
||||
*/
|
||||
class IsJoinPresale
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
if(isset($params['goods_id']))
|
||||
{
|
||||
$presale = new Presale();
|
||||
$res = $presale->isJoinPresaleByGoodsId($params[ 'goods_id' ]);
|
||||
}elseif (isset($params['sku_id'])) {
|
||||
$presale = new Presale();
|
||||
$res = $presale->isJoinPresaleBySkuId($params[ 'sku_id' ]);
|
||||
}elseif (isset($params['sku_ids'])) {
|
||||
$presale = new Presale();
|
||||
$res = $presale->isJoinPresaleBySkuIds($params[ 'sku_ids' ]);
|
||||
}else{
|
||||
$res = error();
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
45
addon/presale/event/MemberAccountFromType.php
Executable file
45
addon/presale/event/MemberAccountFromType.php
Executable file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\presale\event;
|
||||
|
||||
/**
|
||||
* 会员账户变化来源类型
|
||||
*/
|
||||
class MemberAccountFromType
|
||||
{
|
||||
|
||||
public function handle($data)
|
||||
{
|
||||
$from_type = [
|
||||
'balance' => [
|
||||
'presale_order' => [
|
||||
'type_name' => '预售订单',
|
||||
'type_url' => '',
|
||||
],
|
||||
'presale_deposit_refund' => [ 'type_name' => '预售定金退还', 'type_url' => '' ],
|
||||
'presale_refund' => [ 'type_name' => '预售订单退还', 'type_url' => '' ],
|
||||
],
|
||||
'balance_money' => [
|
||||
'presale_order' => [
|
||||
'type_name' => '预售订单',
|
||||
'type_url' => '',
|
||||
]
|
||||
]
|
||||
];
|
||||
if ($data == '') {
|
||||
return $from_type;
|
||||
} else {
|
||||
return $from_type[$data] ?? [];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
30
addon/presale/event/OpenPresale.php
Executable file
30
addon/presale/event/OpenPresale.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\presale\event;
|
||||
|
||||
use addon\presale\model\Presale;
|
||||
|
||||
/**
|
||||
* 启动活动
|
||||
*/
|
||||
class OpenPresale
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
$presale = new Presale();
|
||||
$res = $presale->cronOpenPresale($params[ 'relate_id' ]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
27
addon/presale/event/OrderPromotionType.php
Executable file
27
addon/presale/event/OrderPromotionType.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\presale\event;
|
||||
|
||||
/**
|
||||
* 订单营销活动类型
|
||||
*/
|
||||
class OrderPromotionType
|
||||
{
|
||||
|
||||
/**
|
||||
* 订单营销活动类型
|
||||
* @return array
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return [ "name" => "预售", "type" => "presale" ];
|
||||
}
|
||||
}
|
||||
30
addon/presale/event/PromotionType.php
Executable file
30
addon/presale/event/PromotionType.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\presale\event;
|
||||
|
||||
/**
|
||||
* 活动类型
|
||||
*/
|
||||
class PromotionType
|
||||
{
|
||||
|
||||
/**
|
||||
* 活动类型
|
||||
* @return array
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return [ "name" => "商品预售", "type" => "presale" ];
|
||||
}
|
||||
}
|
||||
100
addon/presale/event/ShowPromotion.php
Executable file
100
addon/presale/event/ShowPromotion.php
Executable file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\presale\event;
|
||||
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
*/
|
||||
class ShowPromotion
|
||||
{
|
||||
public $promotion_type = 'time_limit';
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
*
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function handle($params = [])
|
||||
{
|
||||
$data = [
|
||||
'shop' => [
|
||||
[
|
||||
//插件名称
|
||||
'name' => 'presale',
|
||||
//店铺端展示分类 shop:营销活动 member:互动营销
|
||||
'show_type' => 'shop',
|
||||
//展示主题
|
||||
'title' => '商品预售',
|
||||
//展示介绍
|
||||
'description' => '定金膨胀引流预热',
|
||||
//展示图标
|
||||
'icon' => 'addon/presale/icon.png',
|
||||
//跳转链接
|
||||
'url' => 'presale://shop/presale/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_presale")->getCount([ [ 'site_id', '=', $params[ 'site_id' ] ] ]);
|
||||
return [
|
||||
'count' => $count
|
||||
];
|
||||
}
|
||||
//获取活动概况,需要获取开始时间与结束时间
|
||||
if (isset($params[ 'summary' ])) {
|
||||
$join = [
|
||||
[ 'goods g', 'p.goods_id = g.goods_id', 'inner' ]
|
||||
];
|
||||
$list = model("promotion_presale")->getList([
|
||||
[ '', 'exp', Db::raw('not ( (`start_time` >= ' . $params[ 'end_time' ] . ') or (`end_time` <= ' . $params[ 'start_time' ] . '))') ],
|
||||
[ 'p.site_id', '=', $params[ 'site_id' ] ],
|
||||
[ 'p.status', '<>', 3 ],
|
||||
[ 'p.status', '<>', 4 ],
|
||||
[ 'g.goods_state', '=', 1 ],
|
||||
[ 'g.is_delete', '=', 0 ]
|
||||
], 'p.presale_name as promotion_name,p.presale_id as promotion_id,p.start_time,p.end_time', '', 'p', $join, 'p.presale_name');
|
||||
return !empty($list) ? [
|
||||
'time_limit' => [
|
||||
'count' => count($list),
|
||||
'detail' => $list,
|
||||
'color' => '#E066FF'
|
||||
]
|
||||
] : [];
|
||||
}
|
||||
}
|
||||
}
|
||||
26
addon/presale/event/UnInstall.php
Executable file
26
addon/presale/event/UnInstall.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\presale\event;
|
||||
|
||||
/**
|
||||
* 应用卸载
|
||||
*/
|
||||
class UnInstall
|
||||
{
|
||||
/**
|
||||
* 执行卸载
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return success();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user