mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-05-22 06:49:15 +08:00
修改用户等级管理
This commit is contained in:
parent
a94f864982
commit
56fa725e64
@ -24,7 +24,7 @@ class Upgrade extends Controller
|
||||
public function index()
|
||||
{
|
||||
$this->title = '用户等级管理';
|
||||
BaseUserUpgrade::mQuery()->order('number asc')->page();
|
||||
BaseUserUpgrade::mQuery()->order('number asc')->layTable();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,7 @@
|
||||
{extend name="../../admin/view/main"}
|
||||
{extend name="../../admin/view/table"}
|
||||
|
||||
{block name="button"}
|
||||
<!--{if auth("add") and $page.total <= 9}-->
|
||||
<!--{if auth("add")}-->
|
||||
<button class='layui-btn layui-btn-sm layui-btn-primary' data-modal="{:url('add')}">添加用户等级</button>
|
||||
<!--{/if}-->
|
||||
|
||||
@ -10,68 +10,112 @@
|
||||
<!--{/if}-->
|
||||
{/block}
|
||||
|
||||
{block name='content'}
|
||||
<div class="think-box-notify">
|
||||
特别注意:用户等级配置不能随意修改或删除,会影响系统结算与用户升级!
|
||||
|
||||
{block name="content"}
|
||||
<div class="think-box-shadow">
|
||||
<table id="MessageTable" data-url="{:sysuri()}" data-target-search="form.form-search"></table>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
<div class="think-box-shadow margin-top-10">
|
||||
<table class="layui-table" lay-skin="line">
|
||||
{notempty name='list'}
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='list-table-check-td think-checkbox'>
|
||||
<label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
|
||||
</th>
|
||||
<th class="text-left nowrap">用户等级</th>
|
||||
<th class="text-center nowrap">团队计数</th>
|
||||
<th class="text-center nowrap">升级规则</th>
|
||||
<th class="text-center nowrap">入会礼包</th>
|
||||
<th class="text-center nowrap">团队总数</th>
|
||||
<th class="text-center nowrap">直属团队</th>
|
||||
<th class="text-center nowrap">间接团队</th>
|
||||
<th class="text-center nowrap">订单金额</th>
|
||||
<th class="text-left nowrap">奖利规则</th>
|
||||
<th class="text-left nowrap">使用状态</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
{/notempty}
|
||||
<tbody>
|
||||
{foreach $list as $key=>$vo}
|
||||
<tr>
|
||||
<td class='list-table-check-td think-checkbox'>
|
||||
<label><input class="list-check-box" type='checkbox' value='{$vo.id}'></label>
|
||||
</td>
|
||||
<td class="text-left nowrap"> [ <span class="color-blue">VIP{$vo.number}</span> ] {$vo.name|default=''}</td>
|
||||
<td class="text-center nowrap">{if $vo.upgrade_team>0}<b class="layui-icon layui-icon-ok-circle color-green"></b> {else} - {/if}</td>
|
||||
<td class="text-center nowrap">{if $vo.upgrade_type eq 1}<span class="color-green">全部完成</span>{else}<span class="color-blue">任何条件</span>{/if}</td>
|
||||
<td class="text-center nowrap">{if $vo.goods_vip_status>0}<b class="layui-icon layui-icon-ok-circle color-green"></b> {else} - {/if}</td>
|
||||
<td class="text-center nowrap">{if $vo.teams_users_status>0} <b class="color-green">{$vo.teams_users_number}</b> 人 {else} - {/if}</td>
|
||||
<td class="text-center nowrap">{if $vo.teams_direct_status>0} <b class="color-green">{$vo.teams_direct_number}</b> 人 {else} - {/if}</td>
|
||||
<td class="text-center nowrap">{if $vo.teams_indirect_status>0} <b class="color-green">{$vo.teams_indirect_number}</b> 人 {else} - {/if}</td>
|
||||
<td class="text-center nowrap">{if $vo.order_amount_status>0} <b class="color-green">{$vo.order_amount_number+0}</b> 元 {else} - {/if}</td>
|
||||
<td class="text-left">{foreach $vo.rebate_rule as $v}<span class="nowrap margin-right-5">{$v}</span>{/foreach}</td>
|
||||
<td class='text-left nowrap'>{if $vo.status eq 0}<span class="color-red">已禁用</span>{elseif $vo.status eq 1}<span class="color-green">使用中</span>{/if}</td>
|
||||
<td class='text-left nowrap'>
|
||||
<!--{if auth("edit")}-->
|
||||
<a class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}' data-title="编辑用户等级">编 辑</a>
|
||||
<!--{/if}-->
|
||||
{block name='script'}
|
||||
<script>
|
||||
$(function () {
|
||||
// 初始化表格组件
|
||||
$('#MessageTable').layTable({
|
||||
even: true, height: 'full',
|
||||
cols: [[
|
||||
{field: 'number', title: '等级名称', align: 'left', minWidth: 140, templet: '<div>[ VIP{{d.number}} ] {{d.name}}</div>'},
|
||||
{
|
||||
field: 'upgrade_team', title: '团队计数', align: 'center', minWidth: 80, templet: function (d) {
|
||||
if (!d.upgrade_team || d.upgrade_team < 1) return '';
|
||||
return '<b class="layui-icon layui-icon-ok-circle color-green"></b>';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'upgrade_type', title: '升级规则', align: 'center', minWidth: 100, templet: function (d) {
|
||||
if (d.upgrade_type === 1) return '<span class="color-green">全部完成</span>';
|
||||
else return '<span class="color-blue">任何条件</span>';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'goods_vip_status', title: '入会礼包', align: 'center', minWidth: 80, templet: function (d) {
|
||||
if (!d.goods_vip_status || d.goods_vip_status < 1) return '';
|
||||
return '<b class="layui-icon layui-icon-ok-circle color-green"></b>';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'teams_users_status', title: '团队总数', align: 'center', minWidth: 80, templet: function (d) {
|
||||
if (!d.teams_users_status || d.teams_users_status < 1) return '';
|
||||
return laytpl('<b>{{d.teams_users_number}}</b>').render(d);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'teams_direct_status', title: '直属团队', align: 'center', minWidth: 80, templet: function (d) {
|
||||
if (!d.teams_direct_status || d.teams_direct_status < 1) return '';
|
||||
return laytpl('<b>{{d.teams_direct_number}}</b>').render(d);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'teams_indirect_status', title: '间接团队', align: 'center', minWidth: 80, templet: function (d) {
|
||||
if (!d.teams_indirect_status || d.teams_indirect_status < 1) return '';
|
||||
return laytpl('<b>{{d.teams_indirect_number}}</b>').render(d);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'order_amount_status', title: '订单金额', align: 'center', minWidth: 80, templet: function (d) {
|
||||
if (!d.order_amount_status || d.order_amount_status < 1) return '';
|
||||
return laytpl('<b>{{d.order_amount_number}}</b>').render(d);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'rebate_rule', title: '奖利规则', align: 'center', minWidth: 140, templet: function (d) {
|
||||
return (d.html = ''), (d.rebate_rule || []).forEach(function (rule) {
|
||||
d.html += laytpl('<span class="layui-badge layui-bg-gray">{{d.v}}</span>').render({v: rule});
|
||||
}), d.html;
|
||||
}
|
||||
},
|
||||
{field: 'status', title: '等级状态', align: 'center', minWidth: 110, templet: '#StatusSwitchTpl'},
|
||||
{field: 'create_at', title: '创建时间', align: 'center', minWidth: 170, sort: true},
|
||||
{toolbar: '#toolbar', title: '操作面板', align: 'center', minWidth: 160, fixed: 'right'},
|
||||
]]
|
||||
});
|
||||
|
||||
<!--{if auth("state") and $vo.status eq 1}-->
|
||||
<a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('state')}" data-value="id#{$vo.id};status#0">禁 用</a>
|
||||
<!--{elseif auth("state") and $vo.status eq 0}-->
|
||||
<a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('state')}" data-value="id#{$vo.id};status#1">启 用</a>
|
||||
<!--{/if}-->
|
||||
// 数据状态切换操作
|
||||
layui.form.on('switch(StatusSwitch)', function (obj) {
|
||||
var data = {id: obj.value, status: obj.elem.checked > 0 ? 1 : 0};
|
||||
$.form.load("{:url('state')}", data, 'post', function (ret) {
|
||||
if (ret.code < 1) $.msg.error(ret.info, 3, function () {
|
||||
$('#MessageTable').trigger('reload');
|
||||
});
|
||||
return false;
|
||||
}, false);
|
||||
});
|
||||
});
|
||||
|
||||
<!--{if auth("remove")}-->
|
||||
<a class="layui-btn layui-btn-sm layui-btn-danger" data-action="{:url('remove')}" data-confirm="确定要删除用户等级吗?" data-csrf="{:systoken('remove')}" data-value="id#{$vo.id}">删 除</a>
|
||||
<!--{/if}-->
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!-- 列表排序权重模板 -->
|
||||
<script type="text/html" id="SortInputTpl">
|
||||
<input type="number" min="0" data-blur-number="0" data-action-blur="{:sysuri()}" data-value="id#{{d.id}};action#sort;sort#{value}" data-loading="false" value="{{d.sort}}" class="layui-input text-center">
|
||||
</script>
|
||||
|
||||
<!-- 数据状态切换模板 -->
|
||||
<script type="text/html" id="StatusSwitchTpl">
|
||||
<!--{if auth("state")}-->
|
||||
<input type="checkbox" value="{{d.id}}" lay-skin="switch" lay-text="已激活|已禁用" lay-filter="StatusSwitch" {{d.status>0?'checked':''}}>
|
||||
<!--{else}-->
|
||||
{{d.status ? '<b class="color-green">已启用</b>' : '<b class="color-red">已禁用</b>'}}
|
||||
<!--{/if}-->
|
||||
</script>
|
||||
|
||||
<!-- 数据操作工具条模板 -->
|
||||
<script type="text/html" id="toolbar">
|
||||
<!--{if auth('edit')}-->
|
||||
<a class="layui-btn layui-btn-primary layui-btn-sm" data-open='{:url("edit")}?id={{d.id}}'>编 辑</a>
|
||||
<!--{/if}-->
|
||||
|
||||
<!--{if auth("remove")}-->
|
||||
<a class="layui-btn layui-btn-danger layui-btn-sm" data-confirm="确定要删除问题吗?" data-action="{:url('remove')}" data-value="id#{{d.id}}">删 除</a>
|
||||
<!--{/if}-->
|
||||
</script>
|
||||
{/block}
|
Loading…
x
Reference in New Issue
Block a user