初始上传
This commit is contained in:
29
addon/shopcomponent/event/DeleteGoods.php
Executable file
29
addon/shopcomponent/event/DeleteGoods.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\shopcomponent\event;
|
||||
|
||||
use addon\shopcomponent\model\Goods;
|
||||
|
||||
/**
|
||||
* 商品删除之后
|
||||
*/
|
||||
class DeleteGoods
|
||||
{
|
||||
|
||||
public function handle($data)
|
||||
{
|
||||
$goods = new Goods();
|
||||
foreach (explode(',', $data['goods_id']) as $goods_id) {
|
||||
$goods->deleteGoods($goods_id, $data['site_id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
27
addon/shopcomponent/event/GoodsEdit.php
Executable file
27
addon/shopcomponent/event/GoodsEdit.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\shopcomponent\event;
|
||||
|
||||
use addon\shopcomponent\model\Goods;
|
||||
|
||||
/**
|
||||
* 商品编辑之后
|
||||
*/
|
||||
class GoodsEdit
|
||||
{
|
||||
|
||||
public function handle($data)
|
||||
{
|
||||
$goods = new Goods();
|
||||
$goods->updateGoods(['goods_id' => $data['goods_id'], 'site_id' => $data['site_id'] ]);
|
||||
}
|
||||
}
|
||||
26
addon/shopcomponent/event/Install.php
Executable file
26
addon/shopcomponent/event/Install.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\shopcomponent\event;
|
||||
|
||||
/**
|
||||
* 应用安装
|
||||
*/
|
||||
class Install
|
||||
{
|
||||
/**
|
||||
* 执行安装
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
return success();
|
||||
}
|
||||
}
|
||||
26
addon/shopcomponent/event/OrderDeliveryAfter.php
Executable file
26
addon/shopcomponent/event/OrderDeliveryAfter.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\shopcomponent\event;
|
||||
|
||||
use addon\shopcomponent\model\Order;
|
||||
|
||||
/**
|
||||
* 订单发货完成
|
||||
*/
|
||||
class OrderDeliveryAfter
|
||||
{
|
||||
|
||||
public function handle($data)
|
||||
{
|
||||
$res = ( new Order() )->delivery($data[ 'order_id' ]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
37
addon/shopcomponent/event/OrderPay.php
Executable file
37
addon/shopcomponent/event/OrderPay.php
Executable file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\shopcomponent\event;
|
||||
|
||||
use addon\shopcomponent\model\Weapp;
|
||||
|
||||
/**
|
||||
* 订单支付成功
|
||||
*/
|
||||
class OrderPay
|
||||
{
|
||||
|
||||
public function handle($data)
|
||||
{
|
||||
if ($data['is_video_number'] && $data['pay_type'] == 'wechatpay') {
|
||||
$member = model('member')->getInfo([ ['member_id', '=', $data['member_id'] ] ], 'weapp_openid');
|
||||
$pay = model('pay')->getInfo([ ['out_trade_no', '=', $data['out_trade_no'] ] ], 'trade_no,pay_time');
|
||||
$param = [
|
||||
'out_order_id' => $data['order_id'],
|
||||
'openid' => $member['weapp_openid'],
|
||||
'action_type' => 1,
|
||||
'transaction_id' => $pay['trade_no'],
|
||||
'pay_time' => date('Y-m-d H:i:s', $pay['pay_time'])
|
||||
];
|
||||
(new Weapp($data['site_id']))->pay($param);
|
||||
}
|
||||
}
|
||||
}
|
||||
27
addon/shopcomponent/event/OrderRefundApply.php
Executable file
27
addon/shopcomponent/event/OrderRefundApply.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\shopcomponent\event;
|
||||
|
||||
use addon\shopcomponent\model\Order;
|
||||
|
||||
/**
|
||||
* 订单申请维权
|
||||
*/
|
||||
class OrderRefundApply
|
||||
{
|
||||
|
||||
public function handle($data)
|
||||
{
|
||||
// $res = (new Order())->refundApply($data);
|
||||
// return $res;
|
||||
}
|
||||
}
|
||||
26
addon/shopcomponent/event/OrderTakeDeliveryAfter.php
Executable file
26
addon/shopcomponent/event/OrderTakeDeliveryAfter.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\shopcomponent\event;
|
||||
|
||||
use addon\shopcomponent\model\Order;
|
||||
|
||||
/**
|
||||
* 订单收货
|
||||
*/
|
||||
class OrderTakeDeliveryAfter
|
||||
{
|
||||
|
||||
public function handle($data)
|
||||
{
|
||||
$res = ( new Order() )->takeDelivery($data[ 'order_id' ]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
27
addon/shopcomponent/event/RefundStatusChange.php
Executable file
27
addon/shopcomponent/event/RefundStatusChange.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\shopcomponent\event;
|
||||
|
||||
use addon\shopcomponent\model\Order;
|
||||
|
||||
/**
|
||||
* 订单维权状态变更
|
||||
*/
|
||||
class RefundStatusChange
|
||||
{
|
||||
|
||||
public function handle($data)
|
||||
{
|
||||
$res = (new Order())->refundStatusChange($data);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
31
addon/shopcomponent/event/ShopcomponentNotify.php
Executable file
31
addon/shopcomponent/event/ShopcomponentNotify.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\shopcomponent\event;
|
||||
|
||||
use app\model\system\Pay as PayCommon;
|
||||
|
||||
/**
|
||||
* 视频号异步回调
|
||||
*/
|
||||
class shopcomponentNotify
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
if (!empty($params)) {
|
||||
if (isset($params[ 'order_info' ])) {
|
||||
$pay_common = new PayCommon();
|
||||
$order_info = model('order')->getInfo([ [ 'order_id', '=', $params[ 'order_info' ][ 'out_order_id' ] ] ]);
|
||||
$pay_common->onlinePay($order_info[ 'out_trade_no' ], "wechatpay", $params[ 'order_info' ][ "transaction_id" ], "wechatpay");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
46
addon/shopcomponent/event/ShowPromotion.php
Executable file
46
addon/shopcomponent/event/ShowPromotion.php
Executable file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\shopcomponent\event;
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
*/
|
||||
class ShowPromotion
|
||||
{
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
* @return array
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$data = [
|
||||
'shop' => [
|
||||
[
|
||||
//插件名称
|
||||
'name' => 'shopcomponent',
|
||||
//店铺端展示分类 shop:营销活动 member:互动营销
|
||||
'show_type' => 'tool',
|
||||
//展示主题
|
||||
'title' => '微信视频号',
|
||||
//展示介绍
|
||||
'description' => '由于微信接口限制已停用,该插件无法使用,视频号直播开启线上带货新模式',
|
||||
//展示图标
|
||||
'icon' => 'addon/shopcomponent/icon.png',
|
||||
//跳转链接
|
||||
'url' => 'shopcomponent://shop/goods/lists',
|
||||
]
|
||||
]
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
25
addon/shopcomponent/event/SyncWxCategory.php
Executable file
25
addon/shopcomponent/event/SyncWxCategory.php
Executable file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\shopcomponent\event;
|
||||
|
||||
use addon\shopcomponent\model\Category;
|
||||
|
||||
/**
|
||||
* 同步微信类目
|
||||
*/
|
||||
class SyncWxCategory
|
||||
{
|
||||
public function handle($data)
|
||||
{
|
||||
(new Category())->syncCategory($data['relate_id']);
|
||||
}
|
||||
}
|
||||
30
addon/shopcomponent/event/UnInstall.php
Executable file
30
addon/shopcomponent/event/UnInstall.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\shopcomponent\event;
|
||||
|
||||
/**
|
||||
* 应用卸载
|
||||
*/
|
||||
class UnInstall
|
||||
{
|
||||
/**
|
||||
* 执行卸载
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
try {
|
||||
return error('', "系统插件不允许删除");
|
||||
} catch (\Exception $e) {
|
||||
return error('', $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
37
addon/shopcomponent/event/WeappMenu.php
Executable file
37
addon/shopcomponent/event/WeappMenu.php
Executable file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\shopcomponent\event;
|
||||
|
||||
/**
|
||||
* 小程序菜单
|
||||
*/
|
||||
class WeappMenu
|
||||
{
|
||||
|
||||
/**
|
||||
* 小程序菜单
|
||||
* @param $param
|
||||
* @return array
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
if (addon_is_exit('shopcomponent', $param['site_id'])) {
|
||||
$data = [
|
||||
'title' => '微信视频号',
|
||||
'description' => '实现小程序与视频号的连接',
|
||||
'url' => 'shopcomponent://shop/goods/lists',
|
||||
'icon' => 'addon/shopcomponent/icon.png'
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user