初始上传

This commit is contained in:
2026-04-04 17:27:12 +08:00
parent 4d80d28eb4
commit b7e11774ee
11191 changed files with 1588469 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?php
/**
* Niushop商城系统 - 团队十年电商经验汇集巨献!
* =========================================================
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
* ----------------------------------------------
* 官方网址: https://www.niushop.com
* =========================================================
*/
namespace addon\pointcash\event;
/**
* 应用安装
*/
class Install
{
/**
* 执行安装
*/
public function handle()
{
return success();
}
}

View File

@@ -0,0 +1,37 @@
<?php
/**
* Niushop商城系统 - 团队十年电商经验汇集巨献!
* =========================================================
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
* ----------------------------------------------
* 官方网址: https://www.niushop.com
* =========================================================
*/
namespace addon\pointcash\event;
/**
* 会员账户变化来源类型
*/
class MemberAccountFromType
{
public function handle($data)
{
$from_type = [
'point' => [
'pointcash' => [
'type_name' => '积分抵现',
'type_url' => '',
],
]
];
if ($data == '') {
return $from_type;
} else {
return $from_type[$data] ?? [];
}
}
}

View File

@@ -0,0 +1,34 @@
<?php
/**
* Niushop商城系统 - 团队十年电商经验汇集巨献!
* =========================================================
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
* ----------------------------------------------
* 官方网址: https://www.niushop.com
* =========================================================
*/
namespace addon\pointcash\event;
use addon\pointcash\model\Config;
/**
* 积分规则
*/
class PointRule
{
public function handle($data)
{
$info = (new Config())->getPointCashConfig($data['site_id'])['data'];
$data = [
'title' => '积分抵现',
'content' => !$info['is_use'] || !$info['value']['cash_rate'] ? '-' : $info['value']['cash_rate'] . "积分可抵1元",
'url' => 'pointcash://shop/config/index',
'update_time' => $info['modify_time']
];
return $data;
}
}

View File

@@ -0,0 +1,95 @@
<?php
/**
* Niushop商城系统 - 团队十年电商经验汇集巨献!
* =========================================================
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
* ----------------------------------------------
* 官方网址: https://www.niushop.com
* =========================================================
*/
namespace addon\pointcash\event;
use addon\pointcash\model\Config;
/**
* 活动展示
*/
class ShowPromotion
{
public $promotion_type = 'unlimited_time';
/**
* 活动展示
* @param array $params
* @return array
*/
public function handle($params = [])
{
$data = [
'admin' => [
],
'shop' => [
[
//插件名称
'name' => 'pointcash',
//展示分类根据平台端设置admin平台营销shop店铺营销member:会员营销, tool:应用工具)
'show_type' => 'shop',
//展示主题
'title' => '积分抵现',
//展示介绍
'description' => '下单时积分抵扣现金',
//展示图标
'icon' => 'addon/pointcash/icon.png',
//跳转链接
'url' => 'pointcash://shop/config/index',
'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' ]) || isset($params[ 'summary' ])) $config = ( new Config() )->getPointCashConfig($params[ 'site_id' ])[ 'data' ];
//获取活动数量
if (isset($params[ 'count' ])) {
return [
'count' => $config[ 'is_use' ]
];
}
//获取活动概况,需要获取开始时间与结束时间
if (isset($params[ 'summary' ])) {
$value = $config[ 'value' ];
return [
'unlimited_time' => [
'status' => $config[ 'is_use' ],
'detail' => empty($value[ 'cash_rate' ]) ? '未配置活动' : $value[ 'cash_rate' ] . '积分可抵1元',
'switch_type' => empty($value[ 'cash_rate' ]) ? 'jump' : 'switch',
'config_key' => 'POINTCASH_CONFIG'
]
];
}
}
}

View File

@@ -0,0 +1,25 @@
<?php
/**
* Niushop商城系统 - 团队十年电商经验汇集巨献!
* =========================================================
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
* ----------------------------------------------
* 官方网址: https://www.niushop.com
* =========================================================
*/
namespace addon\pointcash\event;
/**
* 应用卸载
*/
class UnInstall
{
/**
* 执行卸载
*/
public function handle()
{
return error("系统插件不能删除");
}
}