初始上传
This commit is contained in:
23
addon/fenxiao/event/AddSiteDiyView.php
Executable file
23
addon/fenxiao/event/AddSiteDiyView.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
|
||||
/**
|
||||
* 增加默认自定义数据:分销市场
|
||||
*/
|
||||
class AddSiteDiyView
|
||||
{
|
||||
public function handle($param)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
56
addon/fenxiao/event/AddSiteFenxiaoLevel.php
Executable file
56
addon/fenxiao/event/AddSiteFenxiaoLevel.php
Executable file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\FenxiaoLevel as FenxiaoLevelModel;
|
||||
|
||||
/**
|
||||
* 增加默认分销商等级
|
||||
*/
|
||||
class AddSiteFenxiaoLevel
|
||||
{
|
||||
|
||||
public function handle($param)
|
||||
{
|
||||
if (!empty($param[ 'site_id' ])) {
|
||||
|
||||
$model = new FenxiaoLevelModel();
|
||||
$default_level = $model->getLevelInfo([ [ 'site_id', '=', $param[ 'site_id' ] ], [ 'is_default', '=', 1 ] ], 'level_id');
|
||||
|
||||
if (empty($default_level[ 'data' ])) {
|
||||
$data = [
|
||||
'site_id' => $param[ 'site_id' ],
|
||||
'level_name' => '默认等级',
|
||||
'level_num' => 0,
|
||||
'one_rate' => 10.00,
|
||||
'two_rate' => 5.00,
|
||||
'three_rate' => '',
|
||||
'upgrade_type' => '2',
|
||||
'fenxiao_order_num' => '',
|
||||
'fenxiao_order_meney' => '',
|
||||
'one_fenxiao_order_num' => '',
|
||||
'one_fenxiao_order_money' => '',
|
||||
'one_fenxiao_total_order' => '',
|
||||
'order_num' => '',
|
||||
'order_money' => '',
|
||||
'child_num' => '',
|
||||
'child_fenxiao_num' => '',
|
||||
'one_child_num' => '',
|
||||
'one_child_fenxiao_num' => '',
|
||||
'is_default' => 1
|
||||
];
|
||||
$res = $model->addLevel($data);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
39
addon/fenxiao/event/AddStat.php
Executable file
39
addon/fenxiao/event/AddStat.php
Executable file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\FenxiaoStat;
|
||||
|
||||
/**
|
||||
* 分销统计
|
||||
*/
|
||||
class AddStat
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
$type = $params[ 'type' ];
|
||||
$stat_model = new FenxiaoStat();
|
||||
if ($type == 'add_fenxiao_member') {
|
||||
$res = $stat_model->addFenxiaoMemberStat($params[ 'data' ]);
|
||||
return $res;
|
||||
}
|
||||
if ($type == 'fenxiao_order') {
|
||||
$res = $stat_model->addFenxiaoOrderStat($params[ 'data' ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
34
addon/fenxiao/event/AlterShareRelation.php
Executable file
34
addon/fenxiao/event/AlterShareRelation.php
Executable file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\Fenxiao as FenxiaoModel;
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
*/
|
||||
class AlterShareRelation
|
||||
{
|
||||
/**
|
||||
* 用户分销上下级关系
|
||||
* @param $param
|
||||
* @return array|void
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
$fenxiao_model = new FenxiaoModel();
|
||||
return $fenxiao_model->bindRelation([
|
||||
'site_id' => $param[ 'site_id' ],
|
||||
'member_id' => $param[ 'member_id' ],
|
||||
'action' => 'alter_share_relation',
|
||||
]);
|
||||
}
|
||||
}
|
||||
31
addon/fenxiao/event/FenxiaoUpgrade.php
Executable file
31
addon/fenxiao/event/FenxiaoUpgrade.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\Fenxiao;
|
||||
|
||||
/**
|
||||
* 分销商升级
|
||||
*/
|
||||
class FenxiaoUpgrade
|
||||
{
|
||||
/**
|
||||
* 分销商升级
|
||||
* @param $fenxiao_id
|
||||
*/
|
||||
public function handle($fenxiao_id)
|
||||
{
|
||||
if (!empty($fenxiao_id)) {
|
||||
$fenxiao = new Fenxiao();
|
||||
$fenxiao->fenxiaoUpgrade($fenxiao_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
41
addon/fenxiao/event/GoodsListCategoryIds.php
Executable file
41
addon/fenxiao/event/GoodsListCategoryIds.php
Executable file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use app\model\goods\Goods as GoodsModel;
|
||||
|
||||
/**
|
||||
* 商品分类
|
||||
*/
|
||||
class GoodsListCategoryIds
|
||||
{
|
||||
|
||||
/**
|
||||
* 商品营销活动信息
|
||||
* @param $param
|
||||
* @return array
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
if (empty($param[ 'promotion' ]) || $param[ 'promotion' ] != 'fenxiao') return [];
|
||||
|
||||
$condition = [
|
||||
[ 'is_delete', '=', 0 ],
|
||||
[ 'site_id', '=', $param[ 'site_id' ] ],
|
||||
[ 'is_fenxiao', '=', 1 ],
|
||||
[ 'goods_state', '=', 1 ]
|
||||
];
|
||||
|
||||
$model = new GoodsModel();
|
||||
$res = $model->getGoodsCategoryIds($condition);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
61
addon/fenxiao/event/GoodsListPromotion.php
Executable file
61
addon/fenxiao/event/GoodsListPromotion.php
Executable file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use app\model\goods\Goods as GoodsModel;
|
||||
|
||||
/**
|
||||
* 商品营销活动信息
|
||||
*/
|
||||
class GoodsListPromotion
|
||||
{
|
||||
|
||||
/**
|
||||
* 商品营销活动信息
|
||||
* @param $param
|
||||
* @return array
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
if (empty($param[ 'promotion' ]) || $param[ 'promotion' ] != 'fenxiao') return [];
|
||||
|
||||
$alias = 'g';
|
||||
$join = [];
|
||||
|
||||
$condition = [
|
||||
[ 'g.is_delete', '=', 0 ],
|
||||
[ 'g.site_id', '=', $param[ 'site_id' ] ],
|
||||
[ 'g.is_fenxiao', '=', 1 ],
|
||||
[ 'g.goods_state', '=', 1 ]
|
||||
];
|
||||
|
||||
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 GoodsModel();
|
||||
$field = 'g.goods_id,g.goods_name,g.goods_class_name,g.goods_image,g.price,g.goods_stock,g.create_time,g.is_virtual,g.sku_id';
|
||||
$list = $model->getGoodsPageList($condition, $param[ 'page' ], $param[ 'page_size' ], 'g.create_time desc', $field, $alias, $join);
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
57
addon/fenxiao/event/Install.php
Executable file
57
addon/fenxiao/event/Install.php
Executable file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\FenxiaoLevel as FenxiaoLevelModel;
|
||||
|
||||
/**
|
||||
* 应用安装
|
||||
*/
|
||||
class Install
|
||||
{
|
||||
/**
|
||||
* 执行安装
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$site_id = request()->siteid();
|
||||
$model = new FenxiaoLevelModel();
|
||||
$default_level = $model->getLevelInfo([ [ 'site_id', '=', $site_id ], [ 'is_default', '=', 1 ] ], 'level_id');
|
||||
|
||||
if (empty($default_level[ 'data' ])) {
|
||||
$data = [
|
||||
'site_id' => $site_id,
|
||||
'level_name' => '默认等级',
|
||||
'level_num' => 0,
|
||||
'one_rate' => '',
|
||||
'two_rate' => '',
|
||||
'three_rate' => '',
|
||||
'upgrade_type' => '2',
|
||||
'fenxiao_order_num' => '',
|
||||
'fenxiao_order_meney' => '',
|
||||
'one_fenxiao_order_num' => '',
|
||||
'one_fenxiao_order_money' => '',
|
||||
'one_fenxiao_total_order' => '',
|
||||
'order_num' => '',
|
||||
'order_money' => '',
|
||||
'child_num' => '',
|
||||
'child_fenxiao_num' => '',
|
||||
'one_child_num' => '',
|
||||
'one_child_fenxiao_num' => '',
|
||||
'is_default' => 1
|
||||
];
|
||||
$res = $model->addLevel($data);
|
||||
return $res;
|
||||
}
|
||||
|
||||
return success();
|
||||
}
|
||||
}
|
||||
35
addon/fenxiao/event/MemberAccountFromType.php
Executable file
35
addon/fenxiao/event/MemberAccountFromType.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
/**
|
||||
* 会员账户变化来源类型
|
||||
*/
|
||||
class MemberAccountFromType
|
||||
{
|
||||
|
||||
public function handle($data)
|
||||
{
|
||||
$from_type = [
|
||||
'balance_money' => [
|
||||
'fenxiao' => [
|
||||
'type_name' => '分销佣金',
|
||||
'type_url' => '',
|
||||
],
|
||||
],
|
||||
];
|
||||
if ($data == '') {
|
||||
return $from_type;
|
||||
} else {
|
||||
return $from_type[$data] ?? [];
|
||||
}
|
||||
}
|
||||
}
|
||||
31
addon/fenxiao/event/MemberCancel.php
Executable file
31
addon/fenxiao/event/MemberCancel.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\Fenxiao;
|
||||
|
||||
/**
|
||||
* 会员注销
|
||||
*/
|
||||
class MemberCancel
|
||||
{
|
||||
|
||||
/**
|
||||
* @param $param
|
||||
* @return array
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
$fenxiao_model = new Fenxiao();
|
||||
$res = $fenxiao_model->CronMemberCancel($param[ 'member_id' ], $param[ 'site_id' ]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
32
addon/fenxiao/event/MemberRegister.php
Executable file
32
addon/fenxiao/event/MemberRegister.php
Executable file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\Fenxiao;
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
*/
|
||||
class MemberRegister
|
||||
{
|
||||
/**
|
||||
* 会员注册
|
||||
* @param $param
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
if (isset($param['member_id']) && !empty($param['member_id'])) {
|
||||
$fenxiao = new Fenxiao();
|
||||
$fenxiao->memberRegister($param['member_id'], $param['site_id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
35
addon/fenxiao/event/OrderComplete.php
Executable file
35
addon/fenxiao/event/OrderComplete.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\Fenxiao as FenxiaoModel;
|
||||
use app\model\order\OrderCommon;
|
||||
|
||||
/**
|
||||
* 订单完成事件
|
||||
*/
|
||||
class OrderComplete
|
||||
{
|
||||
/**
|
||||
* 订单创建后绑定上下线关系
|
||||
* @param $param
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
$order_id = $param[ 'order_id' ];
|
||||
$order_model = new OrderCommon();
|
||||
$order_info = $order_model->getOrderInfo([ [ 'order_id', '=', $order_id ] ])[ 'data' ];
|
||||
if (!empty($order_info)) {
|
||||
$fenxiao_model = new FenxiaoModel();
|
||||
$fenxiao_model->autoBecomeFenxiao($order_info[ 'member_id' ], $order_info[ 'site_id' ]);
|
||||
}
|
||||
}
|
||||
}
|
||||
38
addon/fenxiao/event/OrderCreateAfter.php
Executable file
38
addon/fenxiao/event/OrderCreateAfter.php
Executable file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\Fenxiao as FenxiaoModel;
|
||||
use app\model\order\OrderCommon;
|
||||
|
||||
/**
|
||||
* 订单创建事件
|
||||
*/
|
||||
class OrderCreateAfter
|
||||
{
|
||||
/**
|
||||
* 订单创建后绑定上下线关系
|
||||
* @param $param
|
||||
* @return array|void
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
$order_info = $param['create_data'] ?? [];
|
||||
if (!empty($order_info)) {
|
||||
$fenxiao_model = new FenxiaoModel();
|
||||
return $fenxiao_model->bindRelation([
|
||||
'site_id' => $order_info[ 'site_id' ],
|
||||
'member_id' => $order_info[ 'member_id' ],
|
||||
'action' => 'order_create',
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
32
addon/fenxiao/event/OrderGoodsRefund.php
Executable file
32
addon/fenxiao/event/OrderGoodsRefund.php
Executable file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\FenxiaoOrder;
|
||||
|
||||
/**
|
||||
* 活动类型
|
||||
*/
|
||||
class OrderGoodsRefund
|
||||
{
|
||||
|
||||
/**
|
||||
* 活动类型
|
||||
* @param $data
|
||||
* @return array
|
||||
*/
|
||||
public function handle($data)
|
||||
{
|
||||
$order_model = new FenxiaoOrder();
|
||||
$res = $order_model->refund($data);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
41
addon/fenxiao/event/OrderPayAfter.php
Executable file
41
addon/fenxiao/event/OrderPayAfter.php
Executable file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\FenxiaoOrder;
|
||||
use addon\fenxiao\model\Fenxiao as FenxiaoModel;
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
*/
|
||||
class OrderPayAfter
|
||||
{
|
||||
|
||||
/**
|
||||
* 订单结算
|
||||
*/
|
||||
public function handle($order)
|
||||
{
|
||||
//先检测是否需要绑定上下线
|
||||
$fenxiao_model = new FenxiaoModel();
|
||||
$fenxiao_model->bindRelation([
|
||||
'site_id' => $order['site_id'],
|
||||
'member_id' => $order['member_id'],
|
||||
'action' => 'order_pay',
|
||||
]);
|
||||
// 自动成为分销商
|
||||
$fenxiao_model->autoBecomeFenxiao($order['member_id'], $order['site_id']);
|
||||
$fenxiao_order = new FenxiaoOrder();
|
||||
return $fenxiao_order->calculate($order);
|
||||
}
|
||||
}
|
||||
34
addon/fenxiao/event/OrderSettlement.php
Executable file
34
addon/fenxiao/event/OrderSettlement.php
Executable file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\FenxiaoOrder;
|
||||
|
||||
/**
|
||||
* 活动类型
|
||||
*/
|
||||
class OrderSettlement
|
||||
{
|
||||
|
||||
/**
|
||||
* 活动类型
|
||||
* @param $data
|
||||
* @return array
|
||||
*/
|
||||
public function handle($data)
|
||||
{
|
||||
$fenxiao_order_model = new FenxiaoOrder();
|
||||
$fenxiao_order_model->settlement($data['order_id']);
|
||||
$res = $fenxiao_order_model->calculateOrder($data['order_id']);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
40
addon/fenxiao/event/PresaleOrderCreate.php
Executable file
40
addon/fenxiao/event/PresaleOrderCreate.php
Executable file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\Fenxiao as FenxiaoModel;
|
||||
use addon\presale\model\PresaleOrder;
|
||||
|
||||
/**
|
||||
* 预售订单创建
|
||||
*/
|
||||
class PresaleOrderCreate
|
||||
{
|
||||
/**
|
||||
* 订单创建后绑定上下线关系
|
||||
* @param $param
|
||||
* @return array|void
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
$id = $param[ 'id' ];
|
||||
$order_model = new PresaleOrder();
|
||||
$order_info = $order_model->getPresaleOrderInfo([ [ 'id', '=', $id ] ])[ 'data' ];
|
||||
if (!empty($order_info)) {
|
||||
$fenxiao_model = new FenxiaoModel();
|
||||
return $fenxiao_model->bindRelation([
|
||||
'site_id' => $order_info[ 'site_id' ],
|
||||
'member_id' => $order_info[ 'member_id' ],
|
||||
'action' => 'order_create',
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
26
addon/fenxiao/event/PromotionType.php
Executable file
26
addon/fenxiao/event/PromotionType.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
/**
|
||||
* 活动类型
|
||||
*/
|
||||
class PromotionType
|
||||
{
|
||||
/**
|
||||
* 活动类型
|
||||
* @return array
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return [ "name" => "分销", "type" => "fenxiao" ];
|
||||
}
|
||||
}
|
||||
46
addon/fenxiao/event/ShowPromotion.php
Executable file
46
addon/fenxiao/event/ShowPromotion.php
Executable file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
*/
|
||||
class ShowPromotion
|
||||
{
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
* @return array
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$data = [
|
||||
'shop' => [
|
||||
[
|
||||
//插件名称
|
||||
'name' => 'fenxiao',
|
||||
//店铺端展示分类 shop:营销活动 member:互动营销
|
||||
'show_type' => 'member',
|
||||
//展示主题
|
||||
'title' => '分销',
|
||||
//展示介绍
|
||||
'description' => '让客户为您推广销售',
|
||||
//展示图标
|
||||
'icon' => 'addon/fenxiao/icon.png',
|
||||
//跳转链接
|
||||
'url' => 'fenxiao://shop/fenxiao/index',
|
||||
]
|
||||
]
|
||||
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
25
addon/fenxiao/event/UnInstall.php
Executable file
25
addon/fenxiao/event/UnInstall.php
Executable file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
/**
|
||||
* 应用卸载
|
||||
*/
|
||||
class UnInstall
|
||||
{
|
||||
/**
|
||||
* 执行卸载
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return success();
|
||||
}
|
||||
}
|
||||
27
addon/fenxiao/event/WchatShareConfig.php
Executable file
27
addon/fenxiao/event/WchatShareConfig.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\share\WchatShare as ShareModel;
|
||||
|
||||
|
||||
/**
|
||||
* 获取分享配置
|
||||
*/
|
||||
class WchatShareConfig
|
||||
{
|
||||
public function handle($param)
|
||||
{
|
||||
$share_model = new ShareModel();
|
||||
return $share_model->getShareConfig($param);
|
||||
}
|
||||
|
||||
}
|
||||
28
addon/fenxiao/event/WchatShareData.php
Executable file
28
addon/fenxiao/event/WchatShareData.php
Executable file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\share\WchatShare as ShareModel;
|
||||
|
||||
|
||||
/**
|
||||
* 获取分享数据
|
||||
*/
|
||||
class WchatShareData
|
||||
{
|
||||
public function handle($param)
|
||||
{
|
||||
$share_model = new ShareModel();
|
||||
return $share_model->getShareData($param);
|
||||
}
|
||||
|
||||
}
|
||||
28
addon/fenxiao/event/WeappShareConfig.php
Executable file
28
addon/fenxiao/event/WeappShareConfig.php
Executable file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\share\WeappShare as ShareModel;
|
||||
|
||||
|
||||
/**
|
||||
* 获取分享配置
|
||||
*/
|
||||
class WeappShareConfig
|
||||
{
|
||||
public function handle($param)
|
||||
{
|
||||
$share_model = new ShareModel();
|
||||
return $share_model->getShareConfig($param);
|
||||
}
|
||||
|
||||
}
|
||||
28
addon/fenxiao/event/WeappShareData.php
Executable file
28
addon/fenxiao/event/WeappShareData.php
Executable file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\share\WeappShare as ShareModel;
|
||||
|
||||
|
||||
/**
|
||||
* 获取分享数据
|
||||
*/
|
||||
class WeappShareData
|
||||
{
|
||||
public function handle($param)
|
||||
{
|
||||
$share_model = new ShareModel();
|
||||
return $share_model->getShareData($param);
|
||||
}
|
||||
|
||||
}
|
||||
29
addon/fenxiao/event/WithdrawTransferCheck.php
Executable file
29
addon/fenxiao/event/WithdrawTransferCheck.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\FenxiaoWithdraw;
|
||||
|
||||
|
||||
/**
|
||||
* 提现转账通知
|
||||
*/
|
||||
class WithdrawTransferCheck
|
||||
{
|
||||
public function handle($param)
|
||||
{
|
||||
if($param['from_type'] == 'fenxiao_withdraw'){
|
||||
$model = new FenxiaoWithdraw();
|
||||
return $model->transferCheck($param['relate_tag']);
|
||||
}
|
||||
}
|
||||
}
|
||||
29
addon/fenxiao/event/WithdrawTransferNotify.php
Executable file
29
addon/fenxiao/event/WithdrawTransferNotify.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\FenxiaoWithdraw;
|
||||
|
||||
|
||||
/**
|
||||
* 提现转账通知
|
||||
*/
|
||||
class WithdrawTransferNotify
|
||||
{
|
||||
public function handle($param)
|
||||
{
|
||||
if($param['from_type'] == 'fenxiao_withdraw'){
|
||||
$model = new FenxiaoWithdraw();
|
||||
return $model->transferNotify($param);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user