chore(src): 所有代码上传
This commit is contained in:
@@ -1,41 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace addon\manjian\api\controller;
|
||||
|
||||
use app\api\controller\BaseApi;
|
||||
use addon\manjian\model\Manjian as ManjianModel;
|
||||
|
||||
/**
|
||||
* 满减
|
||||
*/
|
||||
class Manjian extends BaseApi
|
||||
{
|
||||
|
||||
/**
|
||||
* 信息
|
||||
* @param int $id
|
||||
* @return false|string
|
||||
*/
|
||||
public function info($id = 0)
|
||||
{
|
||||
$goods_id = $this->params['goods_id'] ?? 0;
|
||||
if (!empty($id)) {
|
||||
$goods_id = $id;
|
||||
}
|
||||
if (empty($goods_id)) {
|
||||
return $this->response($this->error('', 'REQUEST_GOODS_ID'));
|
||||
}
|
||||
$manjian_model = new ManjianModel();
|
||||
$res = $manjian_model->getGoodsManjianInfo($goods_id, $this->site_id);
|
||||
return $this->response($res);
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
namespace addon\manjian\api\controller;
|
||||
|
||||
use app\api\controller\BaseApi;
|
||||
use addon\manjian\model\Manjian as ManjianModel;
|
||||
|
||||
/**
|
||||
* 满减
|
||||
*/
|
||||
class Manjian extends BaseApi
|
||||
{
|
||||
|
||||
/**
|
||||
* 信息
|
||||
* @param int $id
|
||||
* @return false|string
|
||||
*/
|
||||
public function info($id = 0)
|
||||
{
|
||||
$goods_id = $this->params['goods_id'] ?? 0;
|
||||
if (!empty($id)) {
|
||||
$goods_id = $id;
|
||||
}
|
||||
if (empty($goods_id)) {
|
||||
return $this->response($this->error('', 'REQUEST_GOODS_ID'));
|
||||
}
|
||||
$manjian_model = new ManjianModel();
|
||||
$res = $manjian_model->getGoodsManjianInfo($goods_id, $this->site_id);
|
||||
return $this->response($res);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,38 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
return [
|
||||
|
||||
// 自定义模板页面类型,格式:[ 'title' => '页面类型名称', 'name' => '页面标识', 'path' => '页面路径', 'value' => '页面数据,json格式' ]
|
||||
'template' => [],
|
||||
|
||||
// 后台自定义组件——装修
|
||||
'util' => [],
|
||||
|
||||
// 自定义页面路径
|
||||
'link' => [],
|
||||
|
||||
// 自定义图标库
|
||||
'icon_library' => [],
|
||||
|
||||
// uni-app 组件,格式:[ 'name' => '组件名称/文件夹名称', 'path' => '文件路径/目录路径' ],多个逗号隔开,自定义组件名称前缀必须是diy-,也可以引用第三方组件
|
||||
'component' => [],
|
||||
|
||||
// uni-app 页面,多个逗号隔开
|
||||
'pages' => [],
|
||||
|
||||
// 模板信息,格式:'title' => '模板名称', 'name' => '模板标识', 'cover' => '模板封面图', 'preview' => '模板预览图', 'desc' => '模板描述'
|
||||
'info' => [],
|
||||
|
||||
// 主题风格配色,格式可以自由定义扩展,【在uni-app中通过:this.themeStyle... 获取定义的颜色字段,例如:this.themeStyle.main_color】
|
||||
'theme' => [],
|
||||
|
||||
// 自定义页面数据,格式:[ 'title' => '页面名称', 'name' => "页面标识", 'value' => [页面数据,json格式] ]
|
||||
'data' => []
|
||||
<?php
|
||||
return [
|
||||
|
||||
// 自定义模板页面类型,格式:[ 'title' => '页面类型名称', 'name' => '页面标识', 'path' => '页面路径', 'value' => '页面数据,json格式' ]
|
||||
'template' => [],
|
||||
|
||||
// 后台自定义组件——装修
|
||||
'util' => [],
|
||||
|
||||
// 自定义页面路径
|
||||
'link' => [],
|
||||
|
||||
// 自定义图标库
|
||||
'icon_library' => [],
|
||||
|
||||
// uni-app 组件,格式:[ 'name' => '组件名称/文件夹名称', 'path' => '文件路径/目录路径' ],多个逗号隔开,自定义组件名称前缀必须是diy-,也可以引用第三方组件
|
||||
'component' => [],
|
||||
|
||||
// uni-app 页面,多个逗号隔开
|
||||
'pages' => [],
|
||||
|
||||
// 模板信息,格式:'title' => '模板名称', 'name' => '模板标识', 'cover' => '模板封面图', 'preview' => '模板预览图', 'desc' => '模板描述'
|
||||
'info' => [],
|
||||
|
||||
// 主题风格配色,格式可以自由定义扩展,【在uni-app中通过:this.themeStyle... 获取定义的颜色字段,例如:this.themeStyle.main_color】
|
||||
'theme' => [],
|
||||
|
||||
// 自定义页面数据,格式:[ 'title' => '页面名称', 'name' => "页面标识", 'value' => [页面数据,json格式] ]
|
||||
'data' => []
|
||||
];
|
||||
@@ -1,21 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
return [
|
||||
'name' => 'manjian',
|
||||
'title' => '满额立减',
|
||||
'description' => '满额立减',
|
||||
'type' => 'promotion', //插件类型 system :系统插件(自动安装), promotion:扩展营销插件 tool:工具插件
|
||||
'status' => 1,
|
||||
'author' => '',
|
||||
'version' => '5.3.1',
|
||||
'version_no' => '525231212001',
|
||||
'content' => '',
|
||||
<?php
|
||||
return [
|
||||
'name' => 'manjian',
|
||||
'title' => '满额立减',
|
||||
'description' => '满额立减',
|
||||
'type' => 'promotion', //插件类型 system :系统插件(自动安装), promotion:扩展营销插件 tool:工具插件
|
||||
'status' => 1,
|
||||
'author' => '',
|
||||
'version' => '5.3.1',
|
||||
'version_no' => '525231212001',
|
||||
'content' => '',
|
||||
];
|
||||
@@ -1,28 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace addon\manjian\event;
|
||||
|
||||
use addon\manjian\model\Manjian;
|
||||
|
||||
/**
|
||||
* 关闭活动
|
||||
*/
|
||||
class CloseManjian
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
$manjian = new Manjian();
|
||||
$res = $manjian->cronCloseManjian($params['relate_id']);
|
||||
return $res;
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace addon\manjian\event;
|
||||
|
||||
use addon\manjian\model\Manjian;
|
||||
|
||||
/**
|
||||
* 关闭活动
|
||||
*/
|
||||
class CloseManjian
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
$manjian = new Manjian();
|
||||
$res = $manjian->cronCloseManjian($params['relate_id']);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
@@ -1,31 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace addon\manjian\event;
|
||||
|
||||
/**
|
||||
* 应用安装
|
||||
*/
|
||||
class Install
|
||||
{
|
||||
/**
|
||||
* 执行安装
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
try {
|
||||
execute_sql('addon/manjian/data/install.sql');
|
||||
return success();
|
||||
} catch (\Exception $e) {
|
||||
return error('', $e->getMessage());
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace addon\manjian\event;
|
||||
|
||||
/**
|
||||
* 应用安装
|
||||
*/
|
||||
class Install
|
||||
{
|
||||
/**
|
||||
* 执行安装
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
try {
|
||||
execute_sql('addon/manjian/data/install.sql');
|
||||
return success();
|
||||
} catch (\Exception $e) {
|
||||
return error('', $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace addon\manjian\event;
|
||||
|
||||
/**
|
||||
* 会员账户变化来源类型
|
||||
*/
|
||||
class MemberAccountFromType
|
||||
{
|
||||
|
||||
public function handle($data)
|
||||
{
|
||||
$from_type = [
|
||||
'point' => [
|
||||
'manjian' => [
|
||||
'type_name' => '满减送',
|
||||
'type_url' => '',
|
||||
],
|
||||
]
|
||||
];
|
||||
if ($data == '') {
|
||||
return $from_type;
|
||||
} else {
|
||||
return $from_type[$data] ?? [];
|
||||
}
|
||||
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace addon\manjian\event;
|
||||
|
||||
/**
|
||||
* 会员账户变化来源类型
|
||||
*/
|
||||
class MemberAccountFromType
|
||||
{
|
||||
|
||||
public function handle($data)
|
||||
{
|
||||
$from_type = [
|
||||
'point' => [
|
||||
'manjian' => [
|
||||
'type_name' => '满减送',
|
||||
'type_url' => '',
|
||||
],
|
||||
]
|
||||
];
|
||||
if ($data == '') {
|
||||
return $from_type;
|
||||
} else {
|
||||
return $from_type[$data] ?? [];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace addon\manjian\event;
|
||||
|
||||
use addon\manjian\model\Manjian;
|
||||
|
||||
/**
|
||||
* 启动活动
|
||||
*/
|
||||
class OpenManjian
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
$manjian = new Manjian();
|
||||
$res = $manjian->cronOpenManjian($params['relate_id']);
|
||||
return $res;
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace addon\manjian\event;
|
||||
|
||||
use addon\manjian\model\Manjian;
|
||||
|
||||
/**
|
||||
* 启动活动
|
||||
*/
|
||||
class OpenManjian
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
$manjian = new Manjian();
|
||||
$res = $manjian->cronOpenManjian($params['relate_id']);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace addon\manjian\event;
|
||||
|
||||
use addon\manjian\model\Order;
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
* 订单完成
|
||||
*/
|
||||
class OrderPayAfter
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
$order = new Order();
|
||||
$order->orderPay($params);
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace addon\manjian\event;
|
||||
|
||||
use addon\manjian\model\Order;
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
* 订单完成
|
||||
*/
|
||||
class OrderPayAfter
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
$order = new Order();
|
||||
$order->orderPay($params);
|
||||
}
|
||||
}
|
||||
@@ -1,70 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace addon\manjian\event;
|
||||
|
||||
use addon\coupon\model\MemberCoupon;
|
||||
use app\dict\member_account\AccountDict;
|
||||
use app\model\member\MemberAccount;
|
||||
|
||||
/**
|
||||
* 订单完全退款后收回奖励
|
||||
*/
|
||||
class OrderRefundAllFinish
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
$order_info = $params['order_info'];
|
||||
$member_id = $order_info['member_id'];
|
||||
$site_id = $order_info['site_id'];
|
||||
//散客不参与
|
||||
if ($member_id > 0) {
|
||||
$order_id = $order_info['order_id'];
|
||||
$list = model('promotion_mansong_record')->getList([['order_id', '=', $order_id], ['status', '=', 1]]);
|
||||
if (!empty($list)) {
|
||||
$member_coupon_model = new MemberCoupon();
|
||||
foreach ($list as $item) {
|
||||
try {
|
||||
// 发放积分
|
||||
$point = $item[ 'point' ] ?? 0;
|
||||
if ($point > 0) {
|
||||
$member_account = new Memberaccount();
|
||||
$member_account->addMemberAccount($site_id, $member_id, AccountDict::point, -$point, 'point_cancel', $item[ 'manjian_id' ], '活动奖励取消');
|
||||
}
|
||||
// 发放优惠券
|
||||
$coupon = $item['coupon'] ?? '';
|
||||
$coupon_num = $item['coupon_num'] ?? '';
|
||||
if ($coupon && $coupon_num) {
|
||||
$coupon_list = explode(',', $coupon);
|
||||
$coupon_num = explode(',', $coupon_num);
|
||||
$coupon_data = [];
|
||||
foreach ($coupon_list as $k => $coupon_item) {
|
||||
$coupon_data[] = [
|
||||
'coupon_type_id' => $coupon_item,
|
||||
'num' => $coupon_num[ $k ] ?? 1
|
||||
];
|
||||
}
|
||||
$member_coupon_model->cancelByPromotion([
|
||||
'coupon_data' => $coupon_data,
|
||||
'member_id' => $member_id,
|
||||
]);
|
||||
}
|
||||
// 定义为收回奖励
|
||||
model('promotion_mansong_record')->update([ 'status' => 2 ], [ [ 'id', '=', $item[ 'id' ] ] ]);
|
||||
model('promotion_mansong_record')->commit();
|
||||
} catch (\Exception $e) {
|
||||
model('promotion_mansong_record')->rollback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace addon\manjian\event;
|
||||
|
||||
use addon\coupon\model\MemberCoupon;
|
||||
use app\dict\member_account\AccountDict;
|
||||
use app\model\member\MemberAccount;
|
||||
|
||||
/**
|
||||
* 订单完全退款后收回奖励
|
||||
*/
|
||||
class OrderRefundAllFinish
|
||||
{
|
||||
|
||||
public function handle($params)
|
||||
{
|
||||
$order_info = $params['order_info'];
|
||||
$member_id = $order_info['member_id'];
|
||||
$site_id = $order_info['site_id'];
|
||||
//散客不参与
|
||||
if ($member_id > 0) {
|
||||
$order_id = $order_info['order_id'];
|
||||
$list = model('promotion_mansong_record')->getList([['order_id', '=', $order_id], ['status', '=', 1]]);
|
||||
if (!empty($list)) {
|
||||
$member_coupon_model = new MemberCoupon();
|
||||
foreach ($list as $item) {
|
||||
try {
|
||||
// 发放积分
|
||||
$point = $item[ 'point' ] ?? 0;
|
||||
if ($point > 0) {
|
||||
$member_account = new Memberaccount();
|
||||
$member_account->addMemberAccount($site_id, $member_id, AccountDict::point, -$point, 'point_cancel', $item[ 'manjian_id' ], '活动奖励取消');
|
||||
}
|
||||
// 发放优惠券
|
||||
$coupon = $item['coupon'] ?? '';
|
||||
$coupon_num = $item['coupon_num'] ?? '';
|
||||
if ($coupon && $coupon_num) {
|
||||
$coupon_list = explode(',', $coupon);
|
||||
$coupon_num = explode(',', $coupon_num);
|
||||
$coupon_data = [];
|
||||
foreach ($coupon_list as $k => $coupon_item) {
|
||||
$coupon_data[] = [
|
||||
'coupon_type_id' => $coupon_item,
|
||||
'num' => $coupon_num[ $k ] ?? 1
|
||||
];
|
||||
}
|
||||
$member_coupon_model->cancelByPromotion([
|
||||
'coupon_data' => $coupon_data,
|
||||
'member_id' => $member_id,
|
||||
]);
|
||||
}
|
||||
// 定义为收回奖励
|
||||
model('promotion_mansong_record')->update([ 'status' => 2 ], [ [ 'id', '=', $item[ 'id' ] ] ]);
|
||||
model('promotion_mansong_record')->commit();
|
||||
} catch (\Exception $e) {
|
||||
model('promotion_mansong_record')->rollback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,90 +1,82 @@
|
||||
<?php
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace addon\manjian\event;
|
||||
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
*/
|
||||
class ShowPromotion
|
||||
{
|
||||
public $promotion_type = 'time_limit';
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function handle($params = [])
|
||||
{
|
||||
$data = [
|
||||
'shop' => [
|
||||
[
|
||||
//插件名称
|
||||
'name' => 'manjian',
|
||||
//店铺端展示分类 shop:营销活动 member:互动营销
|
||||
'show_type' => 'shop',
|
||||
//展示主题
|
||||
'title' => '满减活动',
|
||||
//展示介绍
|
||||
'description' => '购满指定金额享受优惠',
|
||||
//展示图标
|
||||
'icon' => 'addon/manjian/icon.png',
|
||||
//跳转链接
|
||||
'url' => 'manjian://shop/manjian/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_manjian")->getCount([ [ 'site_id', '=', $params[ 'site_id' ] ] ]);
|
||||
return [
|
||||
'count' => $count
|
||||
];
|
||||
}
|
||||
//获取活动概况,需要获取开始时间与结束时间
|
||||
if (isset($params[ 'summary' ])) {
|
||||
$list = model("promotion_manjian")->getList([
|
||||
[ '', 'exp', Db::raw('not ( (`start_time` >= ' . $params[ 'end_time' ] . ') or (`end_time` <= ' . $params[ 'start_time' ] . '))') ],
|
||||
[ 'site_id', '=', $params[ 'site_id' ] ],
|
||||
[ 'status', '<>', -1 ]
|
||||
], 'manjian_name as promotion_name,manjian_id as promotion_id,start_time,end_time');
|
||||
return !empty($list) ? [
|
||||
'time_limit' => [
|
||||
'count' => count($list),
|
||||
'detail' => $list,
|
||||
'color' => '#FFA666'
|
||||
]
|
||||
] : [];
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace addon\manjian\event;
|
||||
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
*/
|
||||
class ShowPromotion
|
||||
{
|
||||
public $promotion_type = 'time_limit';
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function handle($params = [])
|
||||
{
|
||||
$data = [
|
||||
'shop' => [
|
||||
[
|
||||
//插件名称
|
||||
'name' => 'manjian',
|
||||
//店铺端展示分类 shop:营销活动 member:互动营销
|
||||
'show_type' => 'shop',
|
||||
//展示主题
|
||||
'title' => '满减活动',
|
||||
//展示介绍
|
||||
'description' => '购满指定金额享受优惠',
|
||||
//展示图标
|
||||
'icon' => 'addon/manjian/icon.png',
|
||||
//跳转链接
|
||||
'url' => 'manjian://shop/manjian/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_manjian")->getCount([ [ 'site_id', '=', $params[ 'site_id' ] ] ]);
|
||||
return [
|
||||
'count' => $count
|
||||
];
|
||||
}
|
||||
//获取活动概况,需要获取开始时间与结束时间
|
||||
if (isset($params[ 'summary' ])) {
|
||||
$list = model("promotion_manjian")->getList([
|
||||
[ '', 'exp', Db::raw('not ( (`start_time` >= ' . $params[ 'end_time' ] . ') or (`end_time` <= ' . $params[ 'start_time' ] . '))') ],
|
||||
[ 'site_id', '=', $params[ 'site_id' ] ],
|
||||
[ 'status', '<>', -1 ]
|
||||
], 'manjian_name as promotion_name,manjian_id as promotion_id,start_time,end_time');
|
||||
return !empty($list) ? [
|
||||
'time_limit' => [
|
||||
'count' => count($list),
|
||||
'detail' => $list,
|
||||
'color' => '#FFA666'
|
||||
]
|
||||
] : [];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace addon\manjian\event;
|
||||
|
||||
/**
|
||||
* 应用卸载
|
||||
*/
|
||||
class UnInstall
|
||||
{
|
||||
/**
|
||||
* 执行卸载
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
try {
|
||||
return error('', "系统插件不允许删除");
|
||||
//execute_sql('addon/manjian/data/uninstall.sql');
|
||||
//return success();
|
||||
} catch (\Exception $e) {
|
||||
return error('', $e->getMessage());
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace addon\manjian\event;
|
||||
|
||||
/**
|
||||
* 应用卸载
|
||||
*/
|
||||
class UnInstall
|
||||
{
|
||||
/**
|
||||
* 执行卸载
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
try {
|
||||
return error('', "系统插件不允许删除");
|
||||
//execute_sql('addon/manjian/data/uninstall.sql');
|
||||
//return success();
|
||||
} catch (\Exception $e) {
|
||||
return error('', $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,69 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace addon\manjian\model;
|
||||
|
||||
use addon\coupon\model\Coupon;
|
||||
use app\model\BaseModel;
|
||||
use app\model\member\MemberAccount;
|
||||
use app\model\order\Order as BaseOrder;
|
||||
use app\model\order\OrderCommon;
|
||||
use think\facade\Log;
|
||||
|
||||
class Order extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 订单完成发放满减送所送积分
|
||||
* @param $order_id
|
||||
*/
|
||||
public function orderPay($order_info)
|
||||
{
|
||||
$pay_status = $order_info['pay_status'];
|
||||
if($pay_status == 1){
|
||||
$member_id = $order_info[ 'member_id' ];
|
||||
$order_id = $order_info['order_id'];
|
||||
//存在散客的情况
|
||||
if ($member_id > 0) {
|
||||
$mansong_record = model('promotion_mansong_record')->getList([ [ 'order_id', '=', $order_id ], [ 'status', '=', 0 ] ]);
|
||||
if (!empty($mansong_record)) {
|
||||
model('promotion_mansong_record')->startTrans();
|
||||
foreach ($mansong_record as $item) {
|
||||
try {
|
||||
// 发放积分
|
||||
if (!empty($item[ 'point' ])) {
|
||||
$member_account = new Memberaccount();
|
||||
$member_account->addMemberAccount($item[ 'site_id' ], $item[ 'member_id' ], 'point', $item[ 'point' ], 'manjian', $item[ 'manjian_id' ], "活动奖励发放");
|
||||
}
|
||||
// 发放优惠券
|
||||
if (!empty($item[ 'coupon' ])) {
|
||||
$coupon = new Coupon();
|
||||
$coupon_list = explode(',', $item[ 'coupon' ]);
|
||||
$coupon_num = explode(',', $item[ 'coupon_num' ]);
|
||||
$coupon_data = [];
|
||||
foreach ($coupon_list as $k => $coupon_item) {
|
||||
$coupon_data[] = [
|
||||
'coupon_type_id' => $coupon_item,
|
||||
'num' => $coupon_num[ $k ] ?? 1
|
||||
];
|
||||
}
|
||||
$coupon->giveCoupon($coupon_data, $item[ 'site_id' ], $item[ 'member_id' ], 6, $item['id'], 0, 0);
|
||||
}
|
||||
// 变更发放状态
|
||||
model('promotion_mansong_record')->update([ 'status' => 1 ], [ [ 'id', '=', $item[ 'id' ] ] ]);
|
||||
model('promotion_mansong_record')->commit();
|
||||
} catch (\Exception $e) {
|
||||
model('promotion_mansong_record')->rollback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace addon\manjian\model;
|
||||
|
||||
use addon\coupon\model\Coupon;
|
||||
use app\model\BaseModel;
|
||||
use app\model\member\MemberAccount;
|
||||
use app\model\order\Order as BaseOrder;
|
||||
use app\model\order\OrderCommon;
|
||||
use think\facade\Log;
|
||||
|
||||
class Order extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 订单完成发放满减送所送积分
|
||||
* @param $order_id
|
||||
*/
|
||||
public function orderPay($order_info)
|
||||
{
|
||||
$pay_status = $order_info['pay_status'];
|
||||
if($pay_status == 1){
|
||||
$member_id = $order_info[ 'member_id' ];
|
||||
$order_id = $order_info['order_id'];
|
||||
//存在散客的情况
|
||||
if ($member_id > 0) {
|
||||
$mansong_record = model('promotion_mansong_record')->getList([ [ 'order_id', '=', $order_id ], [ 'status', '=', 0 ] ]);
|
||||
if (!empty($mansong_record)) {
|
||||
model('promotion_mansong_record')->startTrans();
|
||||
foreach ($mansong_record as $item) {
|
||||
try {
|
||||
// 发放积分
|
||||
if (!empty($item[ 'point' ])) {
|
||||
$member_account = new Memberaccount();
|
||||
$member_account->addMemberAccount($item[ 'site_id' ], $item[ 'member_id' ], 'point', $item[ 'point' ], 'manjian', $item[ 'manjian_id' ], "活动奖励发放");
|
||||
}
|
||||
// 发放优惠券
|
||||
if (!empty($item[ 'coupon' ])) {
|
||||
$coupon = new Coupon();
|
||||
$coupon_list = explode(',', $item[ 'coupon' ]);
|
||||
$coupon_num = explode(',', $item[ 'coupon_num' ]);
|
||||
$coupon_data = [];
|
||||
foreach ($coupon_list as $k => $coupon_item) {
|
||||
$coupon_data[] = [
|
||||
'coupon_type_id' => $coupon_item,
|
||||
'num' => $coupon_num[ $k ] ?? 1
|
||||
];
|
||||
}
|
||||
$coupon->giveCoupon($coupon_data, $item[ 'site_id' ], $item[ 'member_id' ], 6, $item['id'], 0, 0);
|
||||
}
|
||||
// 变更发放状态
|
||||
model('promotion_mansong_record')->update([ 'status' => 1 ], [ [ 'id', '=', $item[ 'id' ] ] ]);
|
||||
model('promotion_mansong_record')->commit();
|
||||
} catch (\Exception $e) {
|
||||
model('promotion_mansong_record')->rollback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,221 +1,213 @@
|
||||
<?php
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace addon\manjian\shop\controller;
|
||||
|
||||
use addon\coupon\model\CouponType;
|
||||
use app\model\member\MemberLevel;
|
||||
use app\shop\controller\BaseShop;
|
||||
use addon\manjian\model\Manjian as ManjianModel;
|
||||
use think\App;
|
||||
use think\facade\Cache;
|
||||
|
||||
/**
|
||||
* 满减控制器
|
||||
*/
|
||||
class Manjian extends BaseShop
|
||||
{
|
||||
public function __construct(App $app = null)
|
||||
{
|
||||
$this->replace = [
|
||||
'MANJIAN_IMG' => __ROOT__ . '/addon/manjian/shop/view/public/img',
|
||||
'MANJIAN_JS' => __ROOT__ . '/addon/manjian/shop/view/public/js',
|
||||
'MANJIAN_CSS' => __ROOT__ . '/addon/manjian/shop/view/public/css',
|
||||
];
|
||||
parent::__construct($app);
|
||||
}
|
||||
|
||||
/**
|
||||
* 满减列表
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$page = input('page', 1);
|
||||
$page_size = input('page_size', PAGE_LIST_ROWS);
|
||||
$manjian_name = input('manjian_name', '');
|
||||
$status = input('status', '');
|
||||
$condition = [];
|
||||
$condition[] = [ 'site_id', '=', $this->site_id ];
|
||||
$condition[] = [ 'manjian_name', 'like', '%' . $manjian_name . '%' ];
|
||||
if ($status != null) {
|
||||
$condition[] = [ 'status', '=', $status ];
|
||||
}
|
||||
|
||||
$start_time = input('start_time', '');
|
||||
$end_time = input('end_time', '');
|
||||
|
||||
if ($start_time && !$end_time) {
|
||||
$condition[] = [ 'end_time', '>=', date_to_time($start_time) ];
|
||||
} elseif (!$start_time && $end_time) {
|
||||
$condition[] = [ 'start_time', '<=', date_to_time($end_time) ];
|
||||
} elseif ($start_time && $end_time) {
|
||||
$start_timestamp = date_to_time($start_time);
|
||||
$end_timestamp = date_to_time($end_time);
|
||||
$sql = "start_time between {$start_timestamp} and {$end_timestamp}";
|
||||
$sql .= " or end_time between {$start_timestamp} and {$end_timestamp}";
|
||||
$sql .= " or (start_time <= {$start_timestamp} and end_time >= {$end_timestamp})";
|
||||
$condition[] = [ '', 'exp', \think\facade\Db::raw($sql) ];
|
||||
}
|
||||
|
||||
$order = 'create_time desc';
|
||||
$field = 'manjian_id,manjian_name,start_time,end_time,create_time,status';
|
||||
|
||||
$manjian_model = new ManjianModel();
|
||||
$res = $manjian_model->getManjianPageList($condition, $page, $page_size, $order, $field);
|
||||
|
||||
//获取状态名称
|
||||
$manjian_status_arr = $manjian_model->getManjianStatus();
|
||||
foreach ($res[ 'data' ][ 'list' ] as $key => $val) {
|
||||
$res[ 'data' ][ 'list' ][ $key ][ 'status_name' ] = $manjian_status_arr[ $val[ 'status' ] ];
|
||||
}
|
||||
return $res;
|
||||
|
||||
} else {
|
||||
//满减状态
|
||||
$manjian_model = new ManjianModel();
|
||||
$manjian_status_arr = $manjian_model->getManjianStatus();
|
||||
$this->assign('manjian_status_arr', $manjian_status_arr);
|
||||
|
||||
return $this->fetch("manjian/lists");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 满减添加
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$member_level_model = new MemberLevel();
|
||||
if (request()->isJson()) {
|
||||
$data = [
|
||||
'site_id' => $this->site_id,
|
||||
'manjian_name' => input('manjian_name', ''),
|
||||
'manjian_type' => input('manjian_type', ''),
|
||||
'type' => input('type', 0),
|
||||
'number' => input('number', 0),
|
||||
'goods_ids' => input('goods_ids', ''),
|
||||
'start_time' => strtotime(input('start_time', '')),
|
||||
'end_time' => strtotime(input('end_time', '')),
|
||||
'rule_json' => input('rule_json', ''),
|
||||
'remark' => input('remark', '')
|
||||
];
|
||||
|
||||
$manjian_model = new ManjianModel();
|
||||
return $manjian_model->addManjian($data);
|
||||
} else {
|
||||
//获取优惠券列表
|
||||
$coupon_model = new CouponType();
|
||||
$condition = [
|
||||
[ 'status', '=', 1 ],
|
||||
[ 'site_id', '=', $this->site_id ],
|
||||
];
|
||||
//优惠券字段
|
||||
$coupon_field = 'coupon_type_id,type,coupon_name,image,money,discount,validity_type,fixed_term,status,is_limit,at_least,count,lead_count,end_time,goods_type,max_fetch';
|
||||
$coupon_list = $coupon_model->getCouponTypeList($condition, $coupon_field);
|
||||
$this->assign('coupon_list', $coupon_list);
|
||||
$this->assign('level_time', $member_level_model->level_time);
|
||||
return $this->fetch("manjian/add");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 满减编辑
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$member_level_model = new MemberLevel();
|
||||
$manjian_model = new ManjianModel();
|
||||
if (request()->isJson()) {
|
||||
$data = [
|
||||
'manjian_id' => input('manjian_id', 0),
|
||||
'site_id' => $this->site_id,
|
||||
'manjian_name' => input('manjian_name', ''),
|
||||
'manjian_type' => input('manjian_type', ''),
|
||||
'type' => input('type', 0),
|
||||
'goods_ids' => input('goods_ids', ''),
|
||||
'start_time' => strtotime(input('start_time', '')),
|
||||
'end_time' => strtotime(input('end_time', '')),
|
||||
'rule_json' => input('rule_json', ''),
|
||||
'remark' => input('remark', '')
|
||||
];
|
||||
return $manjian_model->editManjian($data);
|
||||
} else {
|
||||
|
||||
$manjian_id = input('manjian_id', 0);
|
||||
$this->assign('manjian_id', $manjian_id);
|
||||
|
||||
$manjian_info = $manjian_model->getManjianDetail($manjian_id, $this->site_id);
|
||||
if (empty($manjian_info[ 'data' ])) $this->error('未获取到活动数据', href_url('manjian://shop/manjian/lists'));
|
||||
$this->assign('manjian_info', $manjian_info[ 'data' ]);
|
||||
//获取优惠券列表
|
||||
$coupon_model = new CouponType();
|
||||
$condition = [
|
||||
[ 'status', '=', 1 ],
|
||||
[ 'site_id', '=', $this->site_id ],
|
||||
];
|
||||
//优惠券字段
|
||||
$coupon_field = 'coupon_type_id,type,coupon_name,image,money,discount,validity_type,fixed_term,status,is_limit,at_least,count,lead_count,end_time,goods_type,max_fetch';
|
||||
$coupon_list = $coupon_model->getCouponTypeList($condition, $coupon_field);
|
||||
$this->assign('coupon_list', $coupon_list);
|
||||
$this->assign('level_time', $member_level_model->level_time);
|
||||
return $this->fetch("manjian/edit");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 满减详情
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$manjian_id = input('manjian_id', 0);
|
||||
$manjian_model = new ManjianModel();
|
||||
$manjian_info = $manjian_model->getManjianDetail($manjian_id, $this->site_id);
|
||||
if (empty($manjian_info[ 'data' ])) $this->error('未获取到活动数据', href_url('manjian://shop/manjian/lists'));
|
||||
$this->assign('manjian_info', $manjian_info[ 'data' ]);
|
||||
return $this->fetch('manjian/detail');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 满减关闭
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$manjian_id = input('manjian_id', 0);
|
||||
$manjian_model = new ManjianModel();
|
||||
return $manjian_model->closeManjian($manjian_id, $this->site_id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 满减删除
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$manjian_id = input('manjian_id', 0);
|
||||
$manjian_model = new ManjianModel();
|
||||
return $manjian_model->deleteManjian($manjian_id, $this->site_id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动冲突商品
|
||||
*/
|
||||
public function conflict()
|
||||
{
|
||||
$key = input('key', '');
|
||||
$conflict_data = Cache::get($key);
|
||||
$this->assign('conflict_data', $conflict_data);
|
||||
return $this->fetch('manjian/conflict');
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace addon\manjian\shop\controller;
|
||||
|
||||
use addon\coupon\model\CouponType;
|
||||
use app\model\member\MemberLevel;
|
||||
use app\shop\controller\BaseShop;
|
||||
use addon\manjian\model\Manjian as ManjianModel;
|
||||
use think\App;
|
||||
use think\facade\Cache;
|
||||
|
||||
/**
|
||||
* 满减控制器
|
||||
*/
|
||||
class Manjian extends BaseShop
|
||||
{
|
||||
public function __construct(App $app = null)
|
||||
{
|
||||
$this->replace = [
|
||||
'MANJIAN_IMG' => __ROOT__ . '/addon/manjian/shop/view/public/img',
|
||||
'MANJIAN_JS' => __ROOT__ . '/addon/manjian/shop/view/public/js',
|
||||
'MANJIAN_CSS' => __ROOT__ . '/addon/manjian/shop/view/public/css',
|
||||
];
|
||||
parent::__construct($app);
|
||||
}
|
||||
|
||||
/**
|
||||
* 满减列表
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$page = input('page', 1);
|
||||
$page_size = input('page_size', PAGE_LIST_ROWS);
|
||||
$manjian_name = input('manjian_name', '');
|
||||
$status = input('status', '');
|
||||
$condition = [];
|
||||
$condition[] = [ 'site_id', '=', $this->site_id ];
|
||||
$condition[] = [ 'manjian_name', 'like', '%' . $manjian_name . '%' ];
|
||||
if ($status != null) {
|
||||
$condition[] = [ 'status', '=', $status ];
|
||||
}
|
||||
|
||||
$start_time = input('start_time', '');
|
||||
$end_time = input('end_time', '');
|
||||
|
||||
if ($start_time && !$end_time) {
|
||||
$condition[] = [ 'end_time', '>=', date_to_time($start_time) ];
|
||||
} elseif (!$start_time && $end_time) {
|
||||
$condition[] = [ 'start_time', '<=', date_to_time($end_time) ];
|
||||
} elseif ($start_time && $end_time) {
|
||||
$start_timestamp = date_to_time($start_time);
|
||||
$end_timestamp = date_to_time($end_time);
|
||||
$sql = "start_time between {$start_timestamp} and {$end_timestamp}";
|
||||
$sql .= " or end_time between {$start_timestamp} and {$end_timestamp}";
|
||||
$sql .= " or (start_time <= {$start_timestamp} and end_time >= {$end_timestamp})";
|
||||
$condition[] = [ '', 'exp', \think\facade\Db::raw($sql) ];
|
||||
}
|
||||
|
||||
$order = 'create_time desc';
|
||||
$field = 'manjian_id,manjian_name,start_time,end_time,create_time,status';
|
||||
|
||||
$manjian_model = new ManjianModel();
|
||||
$res = $manjian_model->getManjianPageList($condition, $page, $page_size, $order, $field);
|
||||
|
||||
//获取状态名称
|
||||
$manjian_status_arr = $manjian_model->getManjianStatus();
|
||||
foreach ($res[ 'data' ][ 'list' ] as $key => $val) {
|
||||
$res[ 'data' ][ 'list' ][ $key ][ 'status_name' ] = $manjian_status_arr[ $val[ 'status' ] ];
|
||||
}
|
||||
return $res;
|
||||
|
||||
} else {
|
||||
//满减状态
|
||||
$manjian_model = new ManjianModel();
|
||||
$manjian_status_arr = $manjian_model->getManjianStatus();
|
||||
$this->assign('manjian_status_arr', $manjian_status_arr);
|
||||
|
||||
return $this->fetch("manjian/lists");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 满减添加
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$member_level_model = new MemberLevel();
|
||||
if (request()->isJson()) {
|
||||
$data = [
|
||||
'site_id' => $this->site_id,
|
||||
'manjian_name' => input('manjian_name', ''),
|
||||
'manjian_type' => input('manjian_type', ''),
|
||||
'type' => input('type', 0),
|
||||
'number' => input('number', 0),
|
||||
'goods_ids' => input('goods_ids', ''),
|
||||
'start_time' => strtotime(input('start_time', '')),
|
||||
'end_time' => strtotime(input('end_time', '')),
|
||||
'rule_json' => input('rule_json', ''),
|
||||
'remark' => input('remark', '')
|
||||
];
|
||||
|
||||
$manjian_model = new ManjianModel();
|
||||
return $manjian_model->addManjian($data);
|
||||
} else {
|
||||
//获取优惠券列表
|
||||
$coupon_model = new CouponType();
|
||||
$condition = [
|
||||
[ 'status', '=', 1 ],
|
||||
[ 'site_id', '=', $this->site_id ],
|
||||
];
|
||||
//优惠券字段
|
||||
$coupon_field = 'coupon_type_id,type,coupon_name,image,money,discount,validity_type,fixed_term,status,is_limit,at_least,count,lead_count,end_time,goods_type,max_fetch';
|
||||
$coupon_list = $coupon_model->getCouponTypeList($condition, $coupon_field);
|
||||
$this->assign('coupon_list', $coupon_list);
|
||||
$this->assign('level_time', $member_level_model->level_time);
|
||||
return $this->fetch("manjian/add");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 满减编辑
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$member_level_model = new MemberLevel();
|
||||
$manjian_model = new ManjianModel();
|
||||
if (request()->isJson()) {
|
||||
$data = [
|
||||
'manjian_id' => input('manjian_id', 0),
|
||||
'site_id' => $this->site_id,
|
||||
'manjian_name' => input('manjian_name', ''),
|
||||
'manjian_type' => input('manjian_type', ''),
|
||||
'type' => input('type', 0),
|
||||
'goods_ids' => input('goods_ids', ''),
|
||||
'start_time' => strtotime(input('start_time', '')),
|
||||
'end_time' => strtotime(input('end_time', '')),
|
||||
'rule_json' => input('rule_json', ''),
|
||||
'remark' => input('remark', '')
|
||||
];
|
||||
return $manjian_model->editManjian($data);
|
||||
} else {
|
||||
|
||||
$manjian_id = input('manjian_id', 0);
|
||||
$this->assign('manjian_id', $manjian_id);
|
||||
|
||||
$manjian_info = $manjian_model->getManjianDetail($manjian_id, $this->site_id);
|
||||
if (empty($manjian_info[ 'data' ])) $this->error('未获取到活动数据', href_url('manjian://shop/manjian/lists'));
|
||||
$this->assign('manjian_info', $manjian_info[ 'data' ]);
|
||||
//获取优惠券列表
|
||||
$coupon_model = new CouponType();
|
||||
$condition = [
|
||||
[ 'status', '=', 1 ],
|
||||
[ 'site_id', '=', $this->site_id ],
|
||||
];
|
||||
//优惠券字段
|
||||
$coupon_field = 'coupon_type_id,type,coupon_name,image,money,discount,validity_type,fixed_term,status,is_limit,at_least,count,lead_count,end_time,goods_type,max_fetch';
|
||||
$coupon_list = $coupon_model->getCouponTypeList($condition, $coupon_field);
|
||||
$this->assign('coupon_list', $coupon_list);
|
||||
$this->assign('level_time', $member_level_model->level_time);
|
||||
return $this->fetch("manjian/edit");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 满减详情
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$manjian_id = input('manjian_id', 0);
|
||||
$manjian_model = new ManjianModel();
|
||||
$manjian_info = $manjian_model->getManjianDetail($manjian_id, $this->site_id);
|
||||
if (empty($manjian_info[ 'data' ])) $this->error('未获取到活动数据', href_url('manjian://shop/manjian/lists'));
|
||||
$this->assign('manjian_info', $manjian_info[ 'data' ]);
|
||||
return $this->fetch('manjian/detail');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 满减关闭
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$manjian_id = input('manjian_id', 0);
|
||||
$manjian_model = new ManjianModel();
|
||||
return $manjian_model->closeManjian($manjian_id, $this->site_id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 满减删除
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$manjian_id = input('manjian_id', 0);
|
||||
$manjian_model = new ManjianModel();
|
||||
return $manjian_model->deleteManjian($manjian_id, $this->site_id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动冲突商品
|
||||
*/
|
||||
public function conflict()
|
||||
{
|
||||
$key = input('key', '');
|
||||
$conflict_data = Cache::get($key);
|
||||
$this->assign('conflict_data', $conflict_data);
|
||||
return $this->fetch('manjian/conflict');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user