添加: 添加交易市场插件
This commit is contained in:
parent
00720baa6e
commit
7afb0b1db9
|
|
@ -16,16 +16,7 @@ return [
|
|||
'util' => [],
|
||||
|
||||
// 自定义页面路径
|
||||
'link' => [
|
||||
[
|
||||
'name' => 'DIY_FUTURES',
|
||||
'title' => '期货',
|
||||
'parent' => 'INTERACTION_PROMOTION',
|
||||
'wap_url' => '',
|
||||
'web_url' => '',
|
||||
'sort' => 4
|
||||
]
|
||||
],
|
||||
'link' => [],
|
||||
|
||||
// 自定义图标库
|
||||
'icon_library' => [],
|
||||
|
|
|
|||
|
|
@ -10,12 +10,14 @@ return [
|
|||
'ShowPromotion' => [
|
||||
'addon\futures\event\ShowPromotion',
|
||||
],
|
||||
'OrderPayment' => [
|
||||
//'addon\form\event\OrderPayment',
|
||||
],
|
||||
'OrderCreate' => [
|
||||
'addon\futures\event\OrderCreate',
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
],
|
||||
|
||||
'subscribe' => [
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@
|
|||
*/
|
||||
return [
|
||||
'name' => 'futures',
|
||||
'title' => '期货',
|
||||
'description' => '期货',
|
||||
'title' => '交易市场',
|
||||
'description' => '交易市场',
|
||||
'type' => 'promotion', //插件类型 system :系统插件(自动安装), business:业务插件 promotion:营销插件 tool:工具插件
|
||||
'status' => 1,
|
||||
'author' => '',
|
||||
|
|
|
|||
|
|
@ -4,77 +4,34 @@
|
|||
// +----------------------------------------------------------------------
|
||||
return [
|
||||
[
|
||||
'name' => 'SYSTEM_FORM',
|
||||
'title' => '系统表单',
|
||||
'url' => 'form://shop/form/lists',
|
||||
'parent' => 'PROMOTION_TOOL',
|
||||
'is_show' => 1,
|
||||
'is_control' => 1,
|
||||
'is_icon' => 0,
|
||||
'picture' => '',
|
||||
'picture_select' => '',
|
||||
'sort' => 1,
|
||||
'child_list' => [
|
||||
'name' => 'TRADING_MARKET',
|
||||
'title' => '交易市场',
|
||||
'url' => 'futures://shop/futures/index',
|
||||
'parent' => 'CHANNEL_ROOT',
|
||||
'is_show' => 1,
|
||||
'sort' => 1,
|
||||
'picture' => 'addon/futures/shop/view/public/img/futures_new.png', // 图标
|
||||
'picture_selected' => 'addon/futures/shop/view/public/img/futures_select.png', // 选中图标
|
||||
'child_list' => [
|
||||
[
|
||||
'name' => 'FORM_ADD',
|
||||
'title' => '添加表单',
|
||||
'url' => 'form://shop/form/addform',
|
||||
'is_show' => 0,
|
||||
'is_control' => 1,
|
||||
'is_icon' => 0,
|
||||
'picture' => '',
|
||||
'picture_selected' => '',
|
||||
'name' => 'TRADING_MARKET_HOME',
|
||||
'title' => '交易市场',
|
||||
'url' => 'futures://shop/futures/index',
|
||||
'is_show' => 1,
|
||||
'sort' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'FORM_EDIT',
|
||||
'title' => '编辑表单',
|
||||
'url' => 'form://shop/form/editform',
|
||||
'is_show' => 0,
|
||||
'is_control' => 1,
|
||||
'is_icon' => 0,
|
||||
'picture' => '',
|
||||
'picture_selected' => '',
|
||||
],
|
||||
[
|
||||
'name' => 'FORM_DELETE',
|
||||
'title' => '删除表单',
|
||||
'url' => 'form://shop/form/deleteform',
|
||||
'is_show' => 0,
|
||||
'is_control' => 1,
|
||||
'is_icon' => 0,
|
||||
'picture' => '',
|
||||
'picture_selected' => '',
|
||||
],
|
||||
[
|
||||
'name' => 'FORM_IS_USE',
|
||||
'title' => '表单是否启用',
|
||||
'url' => 'form://shop/form/editisuse',
|
||||
'is_show' => 0,
|
||||
'is_control' => 1,
|
||||
'is_icon' => 0,
|
||||
'picture' => '',
|
||||
'picture_selected' => '',
|
||||
],
|
||||
[
|
||||
'name' => 'FORM_DATA',
|
||||
'title' => '表单数据',
|
||||
'url' => 'form://shop/form/formdata',
|
||||
'is_show' => 0,
|
||||
'is_control' => 1,
|
||||
'is_icon' => 0,
|
||||
'picture' => '',
|
||||
'picture_selected' => '',
|
||||
],
|
||||
[
|
||||
'name' => 'FORM_DATA_EXPORT',
|
||||
'title' => '表单数据详情',
|
||||
'url' => 'form://shop/form/exportform',
|
||||
'is_show' => 0,
|
||||
'is_control' => 1,
|
||||
'is_icon' => 0,
|
||||
'picture' => '',
|
||||
'picture_selected' => '',
|
||||
'name' => 'TRADING_MARKET_USER',
|
||||
'title' => '用户管理',
|
||||
'url' => 'futures://shop/user/index',
|
||||
'is_show' => 1,
|
||||
'sort' => 2,
|
||||
],
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
]
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace addon\form\event;
|
||||
namespace addon\futures\event;
|
||||
|
||||
/**
|
||||
* 应用安装
|
||||
|
|
|
|||
|
|
@ -1,60 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\form\event;
|
||||
|
||||
use addon\form\model\Form;
|
||||
|
||||
/**
|
||||
* 订单待付款
|
||||
*/
|
||||
class OrderCreate
|
||||
{
|
||||
/**
|
||||
* @return multitype:number unknown
|
||||
*/
|
||||
public function handle($data)
|
||||
{
|
||||
$create_data = $data['create_data'] ?? [];
|
||||
if (isset($create_data['form_data']) && !empty($create_data['form_data'])) {
|
||||
// 添加订单表单
|
||||
$form = new Form();
|
||||
if (isset($create_data['form_data']['form_data'])) {
|
||||
$res = $form->addFormData([
|
||||
'site_id' => $create_data['site_id'],
|
||||
'form_id' => $create_data['form_data']['form_id'],
|
||||
'member_id' => $create_data['member_id'],
|
||||
'relation_id' => $data['order_id'],
|
||||
'form_data' => $create_data['form_data']['form_data'],
|
||||
'scene' => 'order'
|
||||
]);
|
||||
if ($res['code'] != 0) return $res;
|
||||
}
|
||||
|
||||
// 添加商品表单
|
||||
if (isset($create_data['form_data']['goods_form'])) {
|
||||
$goods_list = array_column($create_data['shop_goods_list']['goods_list'], null, 'sku_id');
|
||||
foreach ($create_data['form_data']['goods_form'] as $sku_id => $form_item) {
|
||||
$res = $form->addFormData([
|
||||
'site_id' => $create_data['site_id'],
|
||||
'form_id' => $form_item['form_id'],
|
||||
'member_id' => $create_data['member_id'],
|
||||
'relation_id' => isset($goods_list[ $sku_id ]) && isset($goods_list[ $sku_id ]['order_goods_id']) ? $goods_list[ $sku_id ]['order_goods_id'] : 0,
|
||||
'form_data' => $form_item['form_data'],
|
||||
'scene' => 'goods'
|
||||
]);
|
||||
if ($res['code'] != 0) return $res;
|
||||
}
|
||||
}
|
||||
}
|
||||
return success();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\form\event;
|
||||
|
||||
use addon\form\model\Form;
|
||||
use app\model\goods\Goods;
|
||||
|
||||
/**
|
||||
* 订单待付款
|
||||
*/
|
||||
class OrderPayment
|
||||
{
|
||||
/**
|
||||
* @param $data
|
||||
* @return array
|
||||
*/
|
||||
public function handle($data)
|
||||
{
|
||||
$form = [];
|
||||
$form_model = new Form();
|
||||
$info = $form_model->getFormInfo([ ['site_id', '=', $data['site_id'] ], ['is_use', '=', 1], ['form_type', '=', 'order'] ], 'id,json_data,form_name');
|
||||
if (!empty($info['data'])) {
|
||||
$info['data']['json_data'] = json_decode($info['data']['json_data'], true);
|
||||
$data['system_form'] = $info['data'];
|
||||
}
|
||||
$goods_model = new Goods();
|
||||
foreach ($data['shop_goods_list']['goods_list'] as $goods_key => $goods_item) {
|
||||
$condition = [
|
||||
['g.site_id', '=', $data['site_id'] ],
|
||||
['g.goods_id', '=', $goods_item['goods_id'] ],
|
||||
['g.form_id', '>', 0 ],
|
||||
['f.is_use', '=', 1 ]
|
||||
];
|
||||
$goods_form = $goods_model->getGoodsInfo($condition, 'f.id,f.json_data', 'g', [ ['form f', 'g.form_id = f.id', 'left'] ])['data'];
|
||||
if (!empty($goods_form)) {
|
||||
$goods_form['json_data'] = json_decode($goods_form['json_data'], true);
|
||||
$data['shop_goods_list']['goods_list'][$goods_key]['goods_form'] = $goods_form;
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
|
@ -5,10 +5,11 @@
|
|||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\form\event;
|
||||
namespace addon\futures\event;
|
||||
|
||||
/**
|
||||
* 活动展示
|
||||
|
|
@ -26,17 +27,17 @@ class ShowPromotion
|
|||
'shop' => [
|
||||
[
|
||||
//插件名称
|
||||
'name' => 'futures',
|
||||
'name' => 'futures',
|
||||
//店铺端展示分类 shop:营销活动 member:互动营销
|
||||
'show_type' => 'shop',
|
||||
'show_type' => 'shop',
|
||||
//展示主题
|
||||
'title' => '期货',
|
||||
'title' => '交易市场',
|
||||
//展示介绍
|
||||
'description' => '期货',
|
||||
'description' => '交易市场',
|
||||
//展示图标
|
||||
'icon' => 'addon/futures/icon.png',
|
||||
'icon' => 'addon/futures/icon.png',
|
||||
//跳转链接
|
||||
'url' => 'form://shop/futures/lists',
|
||||
'url' => 'futures://shop/futures/index',
|
||||
]
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
*/
|
||||
|
||||
|
||||
namespace addon\form\event;
|
||||
namespace addon\futures\event;
|
||||
|
||||
/**
|
||||
* 应用卸载
|
||||
|
|
|
|||
|
|
@ -3319,7 +3319,7 @@ return [
|
|||
'title' => '模块管理',
|
||||
'url' => 'shop/system/addon',
|
||||
'parent' => '',
|
||||
'is_show' => 0,
|
||||
'is_show' => 1,
|
||||
'picture' => 'app/shop/view/public/img/icon_new/plug_management_new.png',
|
||||
'picture_selected' => 'app/shop/view/public/img/icon_new/plug_management_select.png',
|
||||
'sort' => 2,
|
||||
|
|
|
|||
Loading…
Reference in New Issue