优化分销等级展示,优化安装sql

This commit is contained in:
吴昊天 2023-02-27 17:19:49 +08:00
parent 4cabb6aa4f
commit f1224b0b81
4 changed files with 53 additions and 11 deletions

View File

@ -66,6 +66,10 @@ class AgentLevelServices extends BaseServices
$query->field('count(*) as sum');
}], $page, $limit);
$count = $this->dao->count($where);
foreach ($list as &$item) {
$item['one_brokerage_ratio'] = bcdiv(bcmul((string)sys_config('store_brokerage_ratio'), bcadd('100', (string)$item['one_brokerage'], 2), 2), '100', 2);
$item['two_brokerage_ratio'] = bcdiv(bcmul((string)sys_config('store_brokerage_two'), bcadd('100', (string)$item['two_brokerage'], 2), 2), '100', 2);
}
return compact('count', 'list');
}
@ -259,8 +263,16 @@ class AgentLevelServices extends BaseServices
$field[] = Form::input('name', '等级名称')->maxlength(8)->col(24);
$field[] = Form::number('grade', '等级', 0)->min(0)->precision(0);
$field[] = Form::frameImage('image', '背景图', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
$field[] = Form::number('one_brokerage', '一级上浮', 0)->info('在分销一级佣金基础上浮(0-1000之间整数)百分比')->min(0)->max(1000)->precision(0);
$field[] = Form::number('two_brokerage', '二级上浮', 0)->info('在分销二级佣金基础上浮(0-1000之间整数)百分比')->min(0)->max(1000)->precision(0);
$field[] = Form::number('one_brokerage', '一级上浮', 0)->appendRule('suffix', [
'type' => 'div',
'class' => 'tips-info',
'domProps' => ['innerHTML' => '在分销一级佣金基础上浮(0-1000之间整数)百分比,目前一级返佣比率:10%,上浮5%,则返佣比率:一级返佣比率 * (1 + 一级上浮比率) = 10.50%']
])->max(1000)->precision(0);
$field[] = Form::number('two_brokerage', '二级上浮', 0)->appendRule('suffix', [
'type' => 'div',
'class' => 'tips-info',
'domProps' => ['innerHTML' => '在分销二级佣金基础上浮(0-1000之间整数)百分比,目前二级返佣比率:10%,上浮2%,则返佣比率:二级返佣比率 * (1 + 二级上浮比率) = 5.10%']
])->min(0)->max(1000)->precision(0);
$field[] = Form::radio('status', '是否显示', 1)->options([['value' => 1, 'label' => '显示'], ['value' => 0, 'label' => '隐藏']]);
return create_form('添加分销员等级', $field, Url::buildUrl('/agent/level'), 'POST');
}
@ -281,8 +293,16 @@ class AgentLevelServices extends BaseServices
$field[] = Form::input('name', '等级名称', $levelInfo['name'])->maxlength(8)->col(24);
$field[] = Form::number('grade', '等级', $levelInfo['grade'])->min(0)->precision(0);
$field[] = Form::frameImage('image', '背景图', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')), $levelInfo['image'])->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]);
$field[] = Form::number('one_brokerage', '一级上浮', $levelInfo['one_brokerage'])->info('在分销一级佣金基础上浮(0-1000之间整数)百分比')->min(0)->max(1000)->precision(0);
$field[] = Form::number('two_brokerage', '二级上浮', $levelInfo['two_brokerage'])->info('在分销二级佣金基础上浮(0-1000之间整数)百分比')->min(0)->max(1000)->precision(0);
$field[] = Form::number('one_brokerage', '一级上浮', $levelInfo['one_brokerage'])->appendRule('suffix', [
'type' => 'div',
'class' => 'tips-info',
'domProps' => ['innerHTML' => '在分销一级佣金基础上浮(0-1000之间整数)百分比,目前一级返佣比率:10%,上浮5%,则返佣比率:一级返佣比率 * (1 + 一级上浮比率) = 10.50%']
])->min(0)->max(1000)->precision(0);
$field[] = Form::number('two_brokerage', '二级上浮', $levelInfo['two_brokerage'])->appendRule('suffix', [
'type' => 'div',
'class' => 'tips-info',
'domProps' => ['innerHTML' => '在分销二级佣金基础上浮(0-1000之间整数)百分比,目前二级返佣比率:10%,上浮2%,则返佣比率:二级返佣比率 * (1 + 二级上浮比率) = 5.10%']
])->min(0)->max(1000)->precision(0);
$field[] = Form::radio('status', '是否显示', $levelInfo['status'])->options([['value' => 1, 'label' => '显示'], ['value' => 0, 'label' => '隐藏']]);
return create_form('编辑分销员等级', $field, Url::buildUrl('/agent/level/' . $id), 'PUT');

View File

@ -33849,7 +33849,7 @@ INSERT INTO `eb_system_menus` (`id`, `pid`, `icon`, `menu_name`, `module`, `cont
(26, 0, 'ios-people', '分销', 'admin', 'agent', '', '', '', '[]', 104, 1, 0, 1, '/agent', '', 1, 'user', 1, 'admin-agent', 0),
(27, 0, 'ios-paper-plane', '营销', 'admin', 'marketing', '', '', '', '[]', 110, 1, 0, 1, '/marketing', '', 1, 'home', 1, 'admin-marketing', 0),
(28, 26, '', '分销设置', 'admin', 'setting.system_config', '', '', '', '[]', 1, 1, 0, 1, '/setting/system_config_retail/2/9', '', 1, 'setting', 0, 'setting-system-config', 0),
(29, 26, '', '分销员管理', 'admin', 'agent.agent_manage', 'index', '', '', '[]', 1, 1, 0, 1, '/agent/agent_manage/index', '', 1, 'user', 0, 'agent-agent-manage', 0),
(29, 26, '', '分销员管理', 'admin', 'agent.agent_manage', 'index', '', '', '[]', 99, 1, 0, 1, '/agent/agent_manage/index', '', 1, 'user', 0, 'agent-agent-manage', 0),
(30, 27, '', '优惠券', 'admin', 'marketing.store_coupon', '', '', '', '[]', 100, 1, 0, 1, '/marketing/store_coupon', '27', 1, 'marketing', 0, 'marketing-store_coupon-index', 0),
(31, 27, '', '砍价管理', 'admin', 'marketing.store_bargain', '', '', '', '[]', 85, 1, 0, 1, '/marketing/store_bargain', '27', 1, 'marketing', 0, 'marketing-store_bargain-index', 0),
(32, 27, '', '拼团管理', 'admin', 'marketing.store_combination', '', '', '', '[]', 80, 1, 0, 1, '/marketing/store_combination', '27', 1, 'marketing', 0, 'marketing-store_combination-index', 0),

View File

@ -374,6 +374,6 @@ export default {
.num {
white-space: nowrap;
margin: 0 10px;
width: 17px;
width: 30px;
}
</style>

View File

@ -38,6 +38,18 @@
</div>
</viewer>
</template>
<template slot-scope="{ row }" slot="one_brokerage">
<span>{{row.one_brokerage}}%</span>
</template>
<template slot-scope="{ row }" slot="one_brokerage_ratio">
<span>{{row.one_brokerage_ratio}}%</span>
</template>
<template slot-scope="{ row }" slot="two_brokerage">
<span>{{row.two_brokerage}}%</span>
</template>
<template slot-scope="{ row }" slot="two_brokerage_ratio">
<span>{{row.two_brokerage_ratio}}%</span>
</template>
<template slot-scope="{ row }" slot="status">
<i-switch
v-model="row.status"
@ -204,14 +216,24 @@ export default {
title: '等级',
},
{
key: 'one_brokerage',
slot: 'one_brokerage',
minWidth: 35,
title: '一级返佣上浮比例(%)',
title: '一级上浮比例',
},
{
key: 'two_brokerage',
slot: 'one_brokerage_ratio',
minWidth: 35,
title: '二级返佣上浮比例(%)',
title: '一级分佣比例(上浮后)',
},
{
slot: 'two_brokerage',
minWidth: 35,
title: '二级上浮比例',
},
{
slot: 'two_brokerage_ratio',
minWidth: 35,
title: '二级分佣比例(上浮后)',
},
{
slot: 'status',
@ -524,7 +546,7 @@ export default {
.headers {
background-color: #fff;
margin-bottom 20px
margin-bottom: 20px;
}
/deep/ .ivu-modal-mask {