mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
增加用户等级
This commit is contained in:
parent
3b984c8a6f
commit
e2daaf9cba
13
app/data/command/UserLevel.php
Normal file
13
app/data/command/UserLevel.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\data\command;
|
||||||
|
|
||||||
|
use think\admin\Command;
|
||||||
|
|
||||||
|
class UserLevel extends Command
|
||||||
|
{
|
||||||
|
protected function configure()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
156
app/data/controller/UserLevel.php
Normal file
156
app/data/controller/UserLevel.php
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\data\controller;
|
||||||
|
|
||||||
|
use think\admin\Controller;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户等级管理
|
||||||
|
* Class UserLevel
|
||||||
|
* @package app\data\controller
|
||||||
|
*/
|
||||||
|
class UserLevel extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 绑定数据表
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $table = 'DataUserLevel';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户等级管理
|
||||||
|
* @auth true
|
||||||
|
* @menu true
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$this->title = '用户等级管理';
|
||||||
|
$this->_query($this->table)->order('number asc')->page();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据列表处理
|
||||||
|
* @param array $data
|
||||||
|
*/
|
||||||
|
protected function _page_filter(array &$data)
|
||||||
|
{
|
||||||
|
foreach ($data as &$vo) {
|
||||||
|
$vo['rebate_rule'] = str2arr($vo['rebate_rule']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加用户等级
|
||||||
|
* @auth true
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$this->_form($this->table, 'form');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑用户等级
|
||||||
|
* @auth true
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$this->_form($this->table, 'form');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单数据处理
|
||||||
|
* @param array $vo
|
||||||
|
*/
|
||||||
|
protected function _form_filter(array &$vo)
|
||||||
|
{
|
||||||
|
if ($this->request->isGet()) {
|
||||||
|
$this->rules = ['首推奖利', '复购奖利', '直属团队', '间接团队', '差额奖励'];
|
||||||
|
$vo['rebate_rule'] = str2arr($vo['rebate_rule'] ?? '');
|
||||||
|
} else {
|
||||||
|
$vo['utime'] = time();
|
||||||
|
$vo['rebate_rule'] = arr2str($vo['rebate_rule'] ?? []);
|
||||||
|
$vo['goods_vip_status'] = isset($vo['goods_vip_status']) ? 1 : 0;
|
||||||
|
$vo['order_amount_status'] = isset($vo['order_amount_status']) ? 1 : 0;
|
||||||
|
$vo['teams_total_status'] = isset($vo['teams_total_status']) ? 1 : 0;
|
||||||
|
$vo['teams_direct_status'] = isset($vo['teams_direct_status']) ? 1 : 0;
|
||||||
|
$vo['teams_indirect_status'] = isset($vo['teams_indirect_status']) ? 1 : 0;
|
||||||
|
// 根据数量判断状态
|
||||||
|
$vo['order_amount_status'] = intval($vo['order_amount_status'] && $vo['order_amount_number'] > 0);
|
||||||
|
$vo['teams_total_status'] = intval($vo['teams_total_status'] && $vo['teams_total_number'] > 0);
|
||||||
|
$vo['teams_direct_status'] = intval($vo['teams_direct_status'] && $vo['teams_direct_number'] > 0);
|
||||||
|
$vo['teams_indirect_status'] = intval($vo['teams_indirect_status'] && $vo['teams_indirect_number'] > 0);
|
||||||
|
$state = 0;
|
||||||
|
foreach ($vo as $k => $v) if (stripos($k, '_status') !== false) $state += $v;
|
||||||
|
if (empty($state)) $this->error('升级条件不能为空!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单结果处理
|
||||||
|
* @param boolean $state
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
*/
|
||||||
|
public function _form_result(bool $state)
|
||||||
|
{
|
||||||
|
if ($state) {
|
||||||
|
$order = 'number asc,utime desc';
|
||||||
|
if (input('old_level', 100) < input('level', '0')) $order = 'number asc,utime asc';
|
||||||
|
foreach ($this->app->db->name($this->table)->order($order)->cursor() as $k => $vo) {
|
||||||
|
$this->app->db->name($this->table)->where(['id' => $vo['id']])->update(['number' => $k + 1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改等级状态
|
||||||
|
* @auth true
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
*/
|
||||||
|
public function state()
|
||||||
|
{
|
||||||
|
$this->_save($this->table);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户等级
|
||||||
|
* @auth true
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
*/
|
||||||
|
public function remove()
|
||||||
|
{
|
||||||
|
$this->_delete($this->table);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态变更处理
|
||||||
|
* @auth true
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
*/
|
||||||
|
protected function _save_result()
|
||||||
|
{
|
||||||
|
$this->_form_result(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除结果处理
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
*/
|
||||||
|
protected function _delete_result()
|
||||||
|
{
|
||||||
|
$this->_form_result(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -209,6 +209,78 @@ class UserService extends Service
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步计算会员级别
|
||||||
|
* @param integer $uid 指定会员uid
|
||||||
|
* @param boolean $parent 同步计算上级
|
||||||
|
* @return boolean
|
||||||
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
|
*/
|
||||||
|
public function syncLevel(int $uid, bool $parent = true): bool
|
||||||
|
{
|
||||||
|
$user = $this->app->db->name('DataUser')->where(['id' => $uid])->find();
|
||||||
|
if (empty($user)) return true;
|
||||||
|
[$level, $title] = [0, '普通用户'];
|
||||||
|
// 统计历史数据
|
||||||
|
$teamsDirect = $this->app->db->name('DataUser')->where(['pid1' => $uid])->count();
|
||||||
|
$teamsIndirect = $this->app->db->name('DataUser')->where(['pid2' => $uid])->count();
|
||||||
|
$amountTotal = $this->app->db->name('ShopOrder')->where(['uid' => $uid])->whereIn('status', [3, 4, 5])->sum('amount_total');
|
||||||
|
// 计算会员级别
|
||||||
|
foreach ($this->app->db->name('DataUserLevel')->where(['status' => 1])->order('number desc')->select()->toArray() as $item) {
|
||||||
|
$l1 = empty($item['goods_vip_status']) || $user['vip_auth'] > 0;
|
||||||
|
$l2 = empty($item['teams_user_status']) || $item['teams_user_number'] <= $teamsDirect + $teamsIndirect;
|
||||||
|
$l3 = empty($item['teams_direct_status']) || $item['teams_direct_number'] <= $teamsDirect;
|
||||||
|
$l4 = empty($item['teams_indirect_status']) || $item['teams_indirect_number'] <= $teamsIndirect;
|
||||||
|
$l5 = empty($item['order_amount_status']) || $item['order_amount_number'] <= $amountTotal;
|
||||||
|
if (
|
||||||
|
($item['upgrade_type'] == 0 && ($l1 || $l2 || $l3 || $l4 || $l5)) /* 满足任何条件可以等级 */
|
||||||
|
||
|
||||||
|
($item['upgrade_type'] == 1 && ($l1 && $l2 && $l3 && $l4 && $l5)) /* 满足所有条件可以等级 */
|
||||||
|
) {
|
||||||
|
[$level, $title] = [$item['number'], $item['name']];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 购买商品升级
|
||||||
|
$query = $this->app->db->name('ShopOrderItem')->alias('b')->rightJoin('store_order a', 'b.order_no=a.order_no');
|
||||||
|
$tempLevel = $query->whereRaw("a.uid={$uid} and a.pay_status=1 and a.status in (3,4,5) and b.vip_mod=1")->max('b.vip_level');
|
||||||
|
if ($tempLevel > $level) {
|
||||||
|
$tempLevelInfo = $this->app->db->name('DataUserLevel')->where(['number' => $tempLevel, 'status' => 1])->find();
|
||||||
|
if (!empty($tempLevelInfo)) [$level, $title] = [$tempLevelInfo['number'], $tempLevelInfo['name']];
|
||||||
|
}
|
||||||
|
// 统计当日数据
|
||||||
|
// $where = ['pay_date_frist' => date('Y-m-d')];
|
||||||
|
// $dailyTeamsDirect = $this->app->db->name('DataUser')->where($where)->where(['pid1' => $uid])->count();
|
||||||
|
// $dailyTeamsIndirect = $this->app->db->name('DataUser')->where($where)->where(['pid2' => $uid])->count();
|
||||||
|
// 统计团队业绩
|
||||||
|
// $teamsPerformanceDirect = $this->app->db->name('ShopOrder')->whereRaw("from_uid={$uid} and status in (3,4,5)")->sum('price_discount');
|
||||||
|
// $mysql2 = $this->app->db->name('DataUser')->field('id')->where(['pid1' => $uid])->buildSql();
|
||||||
|
// $teamsPerformanceIndirect = $this->app->db->name('ShopOrder')->whereRaw("from_uid in {$mysql2} and status in (3,4,5)")->sum('price_discount');
|
||||||
|
// 更新会员数据
|
||||||
|
$data = [
|
||||||
|
'vip_name' => $title,
|
||||||
|
'vip_level' => $level,
|
||||||
|
// 'teams_total' => $teamsDirect + $teamsIndirect,
|
||||||
|
// 'teams_direct' => $teamsDirect,
|
||||||
|
// 'teams_indirect' => $teamsIndirect,
|
||||||
|
// 'amount_order_total' => $amountTotal,
|
||||||
|
// 'teams_performance_total' => $teamsPerformanceDirect + $teamsPerformanceIndirect,
|
||||||
|
// 'teams_performance_direct' => $teamsPerformanceDirect,
|
||||||
|
// 'teams_performance_indirect' => $teamsPerformanceIndirect,
|
||||||
|
// 'amount_profit_total' => $this->app->db->name('StoreProfitRecord')->where(['uid' => $uid])->sum('profit_price'),
|
||||||
|
// 'amount_profit_used' => $this->app->db->name('StoreProfitUsed')->where(['uid' => $uid])->whereIn('status', [1, 2, 3])->sum('pay_price'),
|
||||||
|
// 'amount_profit_lock' => $this->app->db->name('StoreProfitRecord')->where(['uid' => $uid, 'profit_status' => '0'])->sum('profit_price'),
|
||||||
|
// 'daily_teams_total' => $dailyTeamsDirect + $dailyTeamsIndirect,
|
||||||
|
// 'daily_teams_direct' => $dailyTeamsDirect,
|
||||||
|
// 'daily_teams_indirect' => $dailyTeamsIndirect,
|
||||||
|
];
|
||||||
|
if ($data['vip_level'] !== $user['vip_level']) $data['vip_date'] = date('Y-m-d H:i:s');
|
||||||
|
$this->app->db->name('DataUser')->where(['id' => $uid])->update($data);
|
||||||
|
return ($parent && $user['pid2'] > 0) ? $this->syncLevel($user['pid2'], false) : true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取令牌的认证值
|
* 获取令牌的认证值
|
||||||
* @return string
|
* @return string
|
||||||
|
125
app/data/view/user_level/form.html
Normal file
125
app/data/view/user_level/form.html
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
|
||||||
|
<div class="layui-card-body padding-left-40">
|
||||||
|
|
||||||
|
<fieldset class="layui-form-item">
|
||||||
|
<legend class="layui-bg-cyan">用户等级</legend>
|
||||||
|
<div class="layui-form-item layui-row layui-col-space10">
|
||||||
|
<div class="layui-col-xs3 block relative">
|
||||||
|
<span class="color-green label-required-prev">等级序号</span>
|
||||||
|
<select class="layui-select" name="level">
|
||||||
|
{for start="1" end="9" name="i"}
|
||||||
|
{if isset($vo.number) and $vo.number eq $i}
|
||||||
|
<option selected value="{$i}">当前 VIP {$vo.number} 等级</option>
|
||||||
|
{else}
|
||||||
|
<option value="{$i}">设置 VIP {$i} 等级</option>
|
||||||
|
{/if}{/for}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<label class="layui-col-xs9 block relative">
|
||||||
|
<span class="color-green label-required-prev">等级名称</span>
|
||||||
|
<input class="layui-input" name="name" required value="{$vo.name|default=''}" placeholder="请输入等级名称">
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset class="layui-form-item">
|
||||||
|
<legend class="layui-bg-cyan">升级规则</legend>
|
||||||
|
<div class="layui-form-item">
|
||||||
|
{php}$vo['upgrade_type'] = isset($vo['upgrade_type'])?$vo['upgrade_type']:1;{/php}
|
||||||
|
{foreach [1=>'达成所有条件',0=>'达成任何条件'] as $k => $v}
|
||||||
|
{if isset($vo.upgrade_type) and $vo.upgrade_type eq $k}
|
||||||
|
<label class="think-radio"><input checked type="radio" name="upgrade_type" value="{$k}" lay-ignore> {$v}</label>
|
||||||
|
{else}
|
||||||
|
<label class="think-radio"><input type="radio" name="upgrade_type" value="{$k}" lay-ignore> {$v}</label>
|
||||||
|
{/if}{/foreach}
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset class="layui-form-item">
|
||||||
|
<legend class="layui-bg-cyan">升级条件</legend>
|
||||||
|
<div class="font-s13">
|
||||||
|
<label class="layui-form-item block relative think-checkbox notselect">
|
||||||
|
{if isset($vo.goods_vip_status) and $vo.goods_vip_status eq 1}
|
||||||
|
① <input type="checkbox" checked name="goods_vip_status" value="1" lay-ignore>开启
|
||||||
|
{else}
|
||||||
|
① <input type="checkbox" name="goods_vip_status" value="1" lay-ignore>开启
|
||||||
|
{/if}
|
||||||
|
需要 <span class="color-blue">购买入会礼包</span> 达成升级;
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class="layui-form-item block relative think-checkbox notselect">
|
||||||
|
{if isset($vo.teams_direct_status) and $vo.teams_direct_status eq 1}
|
||||||
|
② <input type="checkbox" checked name="teams_direct_status" value="1" lay-ignore>开启
|
||||||
|
{else}
|
||||||
|
② <input type="checkbox" name="teams_direct_status" value="1" lay-ignore>开启
|
||||||
|
{/if}
|
||||||
|
<span class="color-blue">直推团队</span> 升级,<span class="color-blue">直推团队</span> 达到
|
||||||
|
<input class="inline-block text-center" data-blur-number="0" style="width:80px" name="teams_direct_number" value="{$vo.teams_direct_number|default='0'}">
|
||||||
|
人;
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class="layui-form-item block relative think-checkbox notselect">
|
||||||
|
{if isset($vo.teams_indirect_status) and $vo.teams_indirect_status eq 1}
|
||||||
|
③ <input type="checkbox" checked name="teams_indirect_status" value="1" lay-ignore>开启
|
||||||
|
{else}
|
||||||
|
③ <input type="checkbox" name="teams_indirect_status" value="1" lay-ignore>开启
|
||||||
|
{/if}
|
||||||
|
<span class="color-blue">间接团队</span> 升级,<span class="color-blue">间接团队</span> 达到
|
||||||
|
<input class="inline-block text-center" data-blur-number="0" style="width:80px" name="teams_indirect_number" value="{$vo.teams_indirect_number|default='0'}">
|
||||||
|
人;
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class="layui-form-item block relative think-checkbox notselect">
|
||||||
|
{if isset($vo.teams_user_status) and $vo.teams_user_status eq 1}
|
||||||
|
④ <input type="checkbox" checked name="teams_user_status" value="1" lay-ignore>开启
|
||||||
|
{else}
|
||||||
|
④ <input type="checkbox" name="teams_user_status" value="1" lay-ignore>开启
|
||||||
|
{/if}
|
||||||
|
<span class="color-blue">团队总数</span> 升级,<span class="color-blue">团队总数</span> 达到
|
||||||
|
<input class="inline-block text-center" data-blur-number="0" style="width:80px" name="teams_user_number" value="{$vo.teams_user_number|default='0'}">
|
||||||
|
人;
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class="layui-form-item block relative think-checkbox notselect">
|
||||||
|
{if isset($vo.order_amount_status) and $vo.order_amount_status eq 1}
|
||||||
|
⑤ <input type="checkbox" checked name="order_amount_status" value="1" lay-ignore>开启
|
||||||
|
{else}
|
||||||
|
⑤ <input type="checkbox" name="order_amount_status" value="1" lay-ignore>开启
|
||||||
|
{/if}
|
||||||
|
<span class="color-blue">订单总额</span> 升级,<span class="color-blue">订单总额</span> 达到
|
||||||
|
<input class="inline-block text-center" data-blur-number="2" style="width:80px" name="order_amount_number" value="{$vo.order_amount_number|default='0'}">
|
||||||
|
元;
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset class="layui-form-item">
|
||||||
|
<legend class="layui-bg-cyan">发放奖利</legend>
|
||||||
|
<div class="layui-form-item">
|
||||||
|
{foreach $rules as $key}{if isset($vo.rebate_rule) && is_array($vo.rebate_rule) && in_array($key,$vo.rebate_rule)}
|
||||||
|
<label class="think-checkbox"><input checked type="checkbox" name="rebate_rule[]" value="{$key}" lay-ignore> {$key}</label>
|
||||||
|
{else}
|
||||||
|
<label class="think-checkbox"><input type="checkbox" name="rebate_rule[]" value="{$key}" lay-ignore> {$key}</label>
|
||||||
|
{/if}{/foreach}
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset class="layui-form-item layui-hide">
|
||||||
|
<legend class="layui-bg-cyan">等级描述</legend>
|
||||||
|
<label class="layui-form-item block relative">
|
||||||
|
<textarea name="remark" class="layui-textarea" placeholder="请输入用户等级描述">{$vo.remark|default=''}</textarea>
|
||||||
|
</label>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<div class="hr-line-dashed"></div>
|
||||||
|
{notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
|
||||||
|
{notempty name='vo.level'}<input type='hidden' value='{$vo.level}' name='old_level'>{/notempty}
|
||||||
|
|
||||||
|
<div class="layui-form-item text-center">
|
||||||
|
<button class="layui-btn" type='submit'>保存数据</button>
|
||||||
|
<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>form.render()</script>
|
||||||
|
</form>
|
76
app/data/view/user_level/index.html
Normal file
76
app/data/view/user_level/index.html
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
{extend name="../../admin/view/main"}
|
||||||
|
|
||||||
|
{block name="button"}
|
||||||
|
<!--{if auth("add")}-->
|
||||||
|
<button data-modal="{:url('add')}" data-title="添加用户级别" class='layui-btn layui-btn-sm layui-btn-primary'>添加用户级别</button>
|
||||||
|
<!--{/if}-->
|
||||||
|
|
||||||
|
<!--{if auth("sync")}-->
|
||||||
|
<button data-queue="{:url('sync')}" data-confirm="确定要刷新所有用户的统计数据吗?" class='layui-btn layui-btn-sm layui-btn-primary'>刷新用户数据</button>
|
||||||
|
<!--{/if}-->
|
||||||
|
{/block}
|
||||||
|
|
||||||
|
{block name='content'}
|
||||||
|
<div class="layui-badge think-bg-red padding-5 padding-left-10 font-s15 layui-anim layui-anim-upbit">
|
||||||
|
注意,用户级别配置不能随意修改或删除,会影响系统结算与用户升级!
|
||||||
|
</div>
|
||||||
|
<div class="think-box-shadow">
|
||||||
|
<table class="layui-table margin-top-10" 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-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-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" value='{$vo.id}' type='checkbox'/></label>
|
||||||
|
</td>
|
||||||
|
<td class="text-left nowrap"> [ <span class="color-blue">{$vo.number}</span> ] {$vo.name|default=''}</td>
|
||||||
|
<td class="text-left 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_user_status>0} <b class="color-green">{$vo.teams_user_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">{:join(', ',$vo.rebate_rule)}</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}-->
|
||||||
|
|
||||||
|
<!--{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" data-csrf="{:systoken('state')}">禁 用</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" data-csrf="{:systoken('state')}">启 用</a>
|
||||||
|
<!--{/if}-->
|
||||||
|
|
||||||
|
<!--{if auth("remove")}-->
|
||||||
|
<a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除用户级别吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删 除</a>
|
||||||
|
<!--{/if}-->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
|
||||||
|
</div>
|
||||||
|
{/block}
|
Loading…
x
Reference in New Issue
Block a user