修改用户

This commit is contained in:
邹景立 2021-04-07 19:04:24 +08:00
parent 7c354a8048
commit 05cf3b9fcb
9 changed files with 163 additions and 132 deletions

View File

@ -61,13 +61,13 @@ class Order extends Auth
[$items, $order, $truckType, $allowPayments] = [[], [], -1, null]; [$items, $order, $truckType, $allowPayments] = [[], [], -1, null];
$order['uid'] = $this->uuid; $order['uid'] = $this->uuid;
$order['order_no'] = CodeExtend::uniqidDate(18, 'N'); $order['order_no'] = CodeExtend::uniqidDate(18, 'N');
// 推荐人处理 // 代理处理
$order['puid1'] = input('from', $this->user['pid1']); $order['puid1'] = input('from', $this->user['pid1']);
if ($order['puid1'] == $this->uuid) $order['puid1'] = 0; if ($order['puid1'] == $this->uuid) $order['puid1'] = 0;
if ($order['puid1'] > 0) { if ($order['puid1'] > 0) {
$map = ['id' => $order['puid1'], 'status' => 1]; $map = ['id' => $order['puid1'], 'status' => 1];
$order['puid2'] = $this->app->db->name('DataUser')->where($map)->value('pid2'); $order['puid2'] = $this->app->db->name('DataUser')->where($map)->value('pid2');
if (is_null($order['puid2'])) $this->error('推荐人异常'); if (is_null($order['puid2'])) $this->error('代理异常');
} }
// 订单商品处理 // 订单商品处理
foreach (explode('||', $rules) as $rule) { foreach (explode('||', $rules) as $rule) {

View File

@ -65,7 +65,7 @@ class Order extends Controller
// 用户搜索查询 // 用户搜索查询
$db = $this->_query('DataUser')->like('phone#user_phone,nickname#user_nickname')->db(); $db = $this->_query('DataUser')->like('phone#user_phone,nickname#user_nickname')->db();
if ($db->getOptions('where')) $query->whereRaw("uid in {$db->field('id')->buildSql()}"); if ($db->getOptions('where')) $query->whereRaw("uid in {$db->field('id')->buildSql()}");
// 推荐人搜索查询 // 代理搜索查询
$db = $this->_query('DataUser')->like('phone#from_phone,nickname#from_nickname')->db(); $db = $this->_query('DataUser')->like('phone#from_phone,nickname#from_nickname')->db();
if ($db->getOptions('where')) $query->whereRaw("puid1 in {$db->field('id')->buildSql()}"); if ($db->getOptions('where')) $query->whereRaw("puid1 in {$db->field('id')->buildSql()}");
// 列表选项卡 // 列表选项卡

View File

@ -29,14 +29,30 @@ class Admin extends Controller
*/ */
public function index() public function index()
{ {
// 用户等级分组
$levels = UserUpgradeService::instance()->levels();
$totals = ['ta' => ['name' => '全部用户', 'count' => 0, 'vips' => '']];
foreach ($levels as $k => $v) $totals["t{$k}"] = ['name' => $v['name'], 'count' => 0, 'vips' => $k];
$totals['to'] = ['name' => '其他用户', 'count' => 0, 'vips' => ''];
foreach ($this->app->db->name($this->table)->field('vip_code vip,count(1) count')->group('vip_code')->cursor() as $v) {
[$name, $count, $totals['ta']['count']] = ["t{$v['vip']}", $v['count'], $v['count']];
isset($totals[$name]) ? $totals[$name]['count'] += $count : $totals['to']['count'] += $count;
}
if (empty($totals['to']['count'])) unset($totals['to']);
$this->total = $totals;
// 设置页面标题
$this->title = '普通用户管理'; $this->title = '普通用户管理';
$query = $this->_query($this->table); // 创建查询对象
$query = $this->_query($this->table)->order('id desc');
// 数据筛选选项
$this->type = ltrim(input('type', 'ta'), 't');
if (is_numeric($this->type)) $query->where(['vip_code' => $this->type]);
elseif ($this->type === 'o') $query->whereNotIn('vip_code', array_keys($levels));
// 用户搜索查询 // 用户搜索查询
$db = $this->_query('DataUser')->equal('vip_code#from_vipcode')->like('phone#from_phone,username|nickname#from_username')->db(); $db = $this->_query($this->table)->equal('vip_code#from_vipcode')->like('phone#from_phone,username|nickname#from_username')->db();
if ($db->getOptions('where')) $query->whereRaw("pid1 in {$db->field('id')->buildSql()}"); if ($db->getOptions('where')) $query->whereRaw("pid1 in {$db->field('id')->buildSql()}");
// 数据查询分页 // 数据查询分页
$query->like('phone,username|nickname#username')->equal('status,vip_code'); $query->like('phone,username|nickname#username')->equal('status,vip_code')->dateBetween('create_at')->page();
$query->order('id desc')->dateBetween('create_at')->page();
} }
/** /**
@ -59,7 +75,7 @@ class Admin extends Controller
public function parent() public function parent()
{ {
$data = $this->_vali(['pid.default' => '', 'uid.require' => '待操作UID不能为空']); $data = $this->_vali(['pid.default' => '', 'uid.require' => '待操作UID不能为空']);
if ($data['uid'] === $data['pid']) $this->error('推荐人不能是自己'); if ($data['uid'] === $data['pid']) $this->error('代理不能是自己');
if (empty($data['pid'])) { if (empty($data['pid'])) {
$map = [['id', '<>', $data['uid']], ['deleted', '=', 0]]; $map = [['id', '<>', $data['uid']], ['deleted', '=', 0]];
$query = $this->_query($this->table)->where($map)->equal('status,vip_code'); $query = $this->_query($this->table)->where($map)->equal('status,vip_code');
@ -68,10 +84,10 @@ class Admin extends Controller
$user = $this->app->db->name('DataUser')->where(['id' => $data['uid']])->find(); $user = $this->app->db->name('DataUser')->where(['id' => $data['uid']])->find();
$parent = $this->app->db->name('DataUser')->where(['id' => $data['pid']])->find(); $parent = $this->app->db->name('DataUser')->where(['id' => $data['pid']])->find();
if (empty($user)) $this->error('读取用户数据失败!'); if (empty($user)) $this->error('读取用户数据失败!');
if (empty($parent)) $this->error('读取推荐人数据失败!'); if (empty($parent)) $this->error('读取代理数据失败!');
$this->app->db->transaction(function () use ($data, $user, $parent) { $this->app->db->transaction(function () use ($data, $user, $parent) {
if (empty($parent['vip_code'])) $this->error('推荐人无推荐资格'); if (empty($parent['vip_code'])) $this->error('代理无推荐资格');
if (is_numeric(strpos($parent['path'], "-{$data['uid']}-"))) $this->error('推荐人不能绑下属'); if (is_numeric(strpos($parent['path'], "-{$data['uid']}-"))) $this->error('代理不能绑下属');
// 组装当前用户上级数据 // 组装当前用户上级数据
$path = rtrim($parent['path'] ?: '-', '-') . "-{$parent['id']}-"; $path = rtrim($parent['path'] ?: '-', '-') . "-{$parent['id']}-";
// $this->app->db->name('DataUser')->where(['id' => $data['uid']])->update([ // $this->app->db->name('DataUser')->where(['id' => $data['uid']])->update([
@ -92,7 +108,7 @@ class Admin extends Controller
// } // }
}); });
exit; exit;
$this->success('修改推荐人成功!'); $this->success('修改代理成功!');
} catch (\think\exception\HttpResponseException $exception) { } catch (\think\exception\HttpResponseException $exception) {
throw $exception; throw $exception;
} catch (\Exception $exception) { } catch (\Exception $exception) {

View File

@ -85,17 +85,17 @@ class RebateService extends Service
$map = ['id' => $this->order['uid'], 'deleted' => 0]; $map = ['id' => $this->order['uid'], 'deleted' => 0];
$this->user = $this->app->db->name('DataUser')->where($map)->find(); $this->user = $this->app->db->name('DataUser')->where($map)->find();
if (empty($this->user)) throw new Exception('用户不存在'); if (empty($this->user)) throw new Exception('用户不存在');
// 获取直接推荐人数据 // 获取直接代理数据
if ($this->order['puid1'] > 0) { if ($this->order['puid1'] > 0) {
$map = ['id' => $this->order['puid1']]; $map = ['id' => $this->order['puid1']];
$this->from1 = $this->app->db->name('DataUser')->where($map)->find(); $this->from1 = $this->app->db->name('DataUser')->where($map)->find();
if (empty($this->from1)) throw new Exception('直接推荐人不存在'); if (empty($this->from1)) throw new Exception('直接代理不存在');
} }
// 获取间接推荐人数据 // 获取间接代理数据
if ($this->order['puid2'] > 0) { if ($this->order['puid2'] > 0) {
$map = ['id' => $this->order['puid2']]; $map = ['id' => $this->order['puid2']];
$this->from2 = $this->app->db->name('DataUser')->where($map)->find(); $this->from2 = $this->app->db->name('DataUser')->where($map)->find();
if (empty($this->from2)) throw new Exception('间接推荐人不存在'); if (empty($this->from2)) throw new Exception('间接代理不存在');
} }
// 批量发放配置奖励 // 批量发放配置奖励
foreach (self::PRIZES as $vo) if (method_exists($this, $vo['func'])) { foreach (self::PRIZES as $vo) if (method_exists($this, $vo['func'])) {

View File

@ -36,13 +36,13 @@ class UserUpgradeService extends Service
{ {
$user = $this->app->db->name('DataUser')->where(['id' => $uid])->find(); $user = $this->app->db->name('DataUser')->where(['id' => $uid])->find();
if (empty($user)) return [0, '用户查询失败']; if (empty($user)) return [0, '用户查询失败'];
if (!empty($user['pids'])) return [1, '已绑定推荐人']; if (!empty($user['pids'])) return [1, '已绑定代理'];
// 检查代理用户 // 检查代理用户
if (empty($pid)) $pid = $user['pid0']; if (empty($pid)) $pid = $user['pid0'];
if (empty($pid)) return [0, '绑定推荐人不存在']; if (empty($pid)) return [0, '绑定代理不存在'];
if ($uid == $pid) return [0, '推荐人不能是自己']; if ($uid == $pid) return [0, '代理不能是自己'];
$parant = $this->app->db->name('DataUser')->where(['id' => $pid])->find(); $parant = $this->app->db->name('DataUser')->where(['id' => $pid])->find();
if (empty($parant['vip_code'])) return [0, '推荐人无推荐资格']; if (empty($parant['vip_code'])) return [0, '代理无推荐资格'];
if (stripos($parant['path'], "-{$uid}-") !== false) return [0, '不能绑定下属']; if (stripos($parant['path'], "-{$uid}-") !== false) return [0, '不能绑定下属'];
// 组装代理数据 // 组装代理数据
$path = rtrim($parant['path'] ?: '-', '-') . "-{$parant['id']}-"; $path = rtrim($parant['path'] ?: '-', '-') . "-{$parant['id']}-";

View File

@ -47,7 +47,7 @@
<div>推荐手机:<span class="color-text">{$vo.from.phone|default='--'}</span></div> <div>推荐手机:<span class="color-text">{$vo.from.phone|default='--'}</span></div>
</div> </div>
<!--{else}--> <!--{else}-->
<div class="color-desc padding-10">没有推荐人</div> <div class="color-desc padding-10">没有代理</div>
<!--{/notempty}--> <!--{/notempty}-->
</div> </div>
<div> <div>

View File

@ -7,109 +7,124 @@
{/block} {/block}
{block name="content"} {block name="content"}
<div class="think-box-shadow"> <div class="layui-tab layui-tab-card">
{include file='user/admin/index_search'} <ul class="layui-tab-title notselect sub-strong-text">
<table class="layui-table margin-top-10" lay-skin="line"> {foreach $total as $k=>$v}{if isset($type) and 't'.$type eq $k}
{notempty name='list'} <li class="layui-this" data-open="{:url('index')}?type={$k}">
<thead> {if is_numeric($v.vips)}[<b class="margin-col-5">VIP{$v.vips}</b>]<span class="padding-left-5"></span>{/if}
<tr> <b>{$v.name}</b><sup class="layui-badge border-radius">{$v.count|default=0}</sup>
<th class='list-table-check-td think-checkbox'> </li>
<label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label> {else}
</th> <li data-open="{:url('index')}?type={$k}">
<th class='nowrap'>用户信息</th> {if is_numeric($v.vips)}[<b class="margin-col-5">VIP{$v.vips}</b>]<span class="padding-left-5"></span>{/if}
<th class='nowrap'>推荐人信息</th> <b>{$v.name}</b><sup class="layui-badge border-radius">{$v.count|default=0}</sup>
<th class='nowrap'>余额统计</th> </li>
<th class='nowrap'>返利统计</th> {/if}{/foreach}
<th class='nowrap'>团队统计</th> </ul>
<th class='nowrap'>用户状态</th> <div class="layui-tab-content">
<th class='nowrap'></th> {include file='user/admin/index_search'}
</tr> <table class="layui-table margin-top-10" lay-skin="line">
</thead> {notempty name='list'}
{/notempty} <thead>
<tbody> <tr>
{foreach $list as $key=>$vo} <th class='list-table-check-td think-checkbox'>
<tr> <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
<td class='list-table-check-td think-checkbox'> </th>
<label><input class="list-check-box" type='checkbox' value='{$vo.id}'></label> <th class='nowrap'>用户信息</th>
</td> <th class='nowrap'>代理信息</th>
<td class="nowrap"> <th class='nowrap'>余额统计</th>
<div class="headimg headimg-md" data-lazy-src="{$vo.headimg|default='__ROOT__/static/theme/img/headimg.png'}" data-tips-image></div> <th class='nowrap'>返利统计</th>
<div class="inline-block"> <th class='nowrap'>团队统计</th>
<div> <th class='nowrap'>用户状态</th>
{notempty name='vo.username'} <th class='nowrap'></th>
用户姓名:<span class="color-text">{$vo.username|default='-'}</span> </tr>
{else} </thead>
用户昵称:<span class="color-text">{$vo.nickname|default='-'}</span> {/notempty}
{/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="nowrap">
<div class="headimg headimg-md" data-lazy-src="{$vo.headimg|default='__ROOT__/static/theme/img/headimg.png'}" data-tips-image></div>
<div class="inline-block">
<div>
{notempty name='vo.username'}
用户姓名:<span class="color-text">{$vo.username|default='-'}</span>
{else}
用户昵称:<span class="color-text">{$vo.nickname|default='-'}</span>
{/notempty}
</div>
<div>用户手机:<span class="color-text">{$vo.phone|default='-'}</span></div>
<div>用户等级:[ <b class="color-red">VIP{$vo.vip_code}</b> ] <b class="color-red">{$vo.vip_name}</b></div>
</div> </div>
<div>用户手机:<span class="color-text">{$vo.phone|default='-'}</span></div> </td>
<div>用户等级:[ <b class="color-red">VIP{$vo.vip_code}</b> ] <b class="color-red">{$vo.vip_name}</b></div> <td class="nowrap">
</div> {notempty name='vo.from'}
</td> <div class="headimg headimg-md" data-lazy-src="{$vo.from.headimg|default='__ROOT__/static/theme/img/headimg.png'}" data-tips-image></div>
<td class="nowrap"> <div class="inline-block text-middle">
{notempty name='vo.from'} <div>
<div class="headimg headimg-md" data-lazy-src="{$vo.from.headimg|default='__ROOT__/static/theme/img/headimg.png'}" data-tips-image></div> {notempty name='vo.from.username'}
<div class="inline-block text-middle"> 用户姓名:<span class="color-text">{$vo.from.username|default='-'}</span>
<div> {else}
{notempty name='vo.from.username'} 用户昵称:<span class="color-text">{$vo.from.nickname|default='-'}</span>
用户姓名:<span class="color-text">{$vo.from.username|default='-'}</span> {/notempty}
{else} </div>
用户昵称:<span class="color-text">{$vo.from.nickname|default='-'}</span> <div>用户手机<span class="color-text">{$vo.from.phone|default='-'}</span></div>
{/notempty} <div>用户等级:[ <b class="color-red">VIP{$vo.from.vip_code}</b> ] <b class="color-red">{$vo.from.vip_name}</b></div>
</div> </div>
<div>用户手机:<span class="color-text">{$vo.from.phone|default='-'}</span></div> {else}
<div>用户等级:[ <b class="color-red">VIP{$vo.from.vip_code}</b> ] <b class="color-red">{$vo.from.vip_name}</b></div> <div class="color-desc">没有代理</div>
</div> {/notempty}
{else} </td>
<div class="color-desc">没有推荐人</div> <td class="nowrap sub-strong-blue sub-strong-s14">
{/notempty} <div>累计充值 <b>{$vo.balance_total+0}</b> </div>
</td> <div>已经交易 <b>{$vo.balance_used+0}</b> </div>
<td class="nowrap sub-strong-blue sub-strong-s14"> <div>可用余额 <b>{:round($vo.balance_total-$vo.balance_used,2)+0}</b> </div>
<div>累计充值 <b>{$vo.balance_total+0}</b> </div> </td>
<div>已经交易 <b>{$vo.balance_used+0}</b> </div> <td class="nowrap sub-strong-blue sub-strong-s14">
<div>可用余额 <b>{:round($vo.balance_total-$vo.balance_used,2)+0}</b> </div> <div>累计返利 <b>{$vo.rebate_total+0}</b><span class="color-red font-w7" data-tips-text="未到账">+{$vo.rebate_lock+0}</span> </div>
</td> <div>已经提现 <b>{$vo.rebate_used+0}</b> </div>
<td class="nowrap sub-strong-blue sub-strong-s14"> <div>剩余提现 <b>{:round($vo.rebate_total-$vo.rebate_used,2)+0}</b> </div>
<div>累计返利 <b>{$vo.rebate_total+0}</b><span class="color-red font-w7" data-tips-text="未到账">+{$vo.rebate_lock+0}</span> </div> </td>
<div>已经提现 <b>{$vo.rebate_used+0}</b> </div> <td class="nowrap sub-strong-blue sub-strong-s14">
<div>剩余提现 <b>{:round($vo.rebate_total-$vo.rebate_used,2)+0}</b> </div> <div>全部团队 <b>{$vo.teams_users_total}</b> ( 业绩 <b>{$vo.teams_amount_total+0}</b> )</div>
</td> <div>直属团队 <b>{$vo.teams_users_direct}</b> ( 业绩 <b>{$vo.teams_amount_direct+0}</b> )</div>
<td class="nowrap sub-strong-blue sub-strong-s14"> <div>间接团队 <b>{$vo.teams_users_indirect}</b> ( 业绩 <b>{$vo.teams_amount_indirect+0}</b> )</div>
<div>全部团队 <b>{$vo.teams_users_total}</b> ( 业绩 <b>{$vo.teams_amount_total+0}</b> )</div> </td>
<div>直属团队 <b>{$vo.teams_users_direct}</b> ( 业绩 <b>{$vo.teams_amount_direct+0}</b> )</div> <td class="nowrap">
<div>间接团队 <b>{$vo.teams_users_indirect}</b> ( 业绩 <b>{$vo.teams_amount_indirect+0}</b> )</div> <div>累计交易:<b class="color-blue font-s14">{$vo.order_amount_total+0}</b> </div>
</td> <div>使用状态:{if $vo.status eq 0}<b class="color-red">已冻结</b>{elseif $vo.status eq 1}<b class="color-green">已激活</b>{/if}
<td class="nowrap"> <!--{notempty name='vo.pids'}--><b class="margin-left-5 color-green">永久绑定</b><!--{else}-->
<div>累计交易:<b class="color-blue font-s14">{$vo.order_amount_total+0}</b> </div> {notempty name='vo.pid0'}<b class="margin-left-5 color-red">临时绑定</b>{else}<b class="margin-left-5 color-desc">没有绑定</b>{/notempty}
<div>使用状态:{if $vo.status eq 0}<b class="color-red">已冻结</b>{elseif $vo.status eq 1}<b class="color-green">已激活</b>{/if} <!--{/notempty}-->
<!--{notempty name='vo.pids'}--><b class="margin-left-5 color-green">永久绑定</b><!--{else}--> </div>
{notempty name='vo.pid0'}<b class="margin-left-5 color-red">临时绑定</b>{else}<b class="margin-left-5 color-desc">没有绑定</b>{/notempty} <div>注册时间:{$vo.create_at|format_datetime}</div>
<!--{/notempty}--> </td>
</div> <td class="nowrap">
<div>注册时间:{$vo.create_at|format_datetime}</div>
</td>
<td class="nowrap">
<!--{if auth("parent") and false}--> <!--{if auth("parent") and false}-->
<a class="layui-btn layui-btn-sm layui-btn-primary" data-iframe="{:url('parent')}?uid={$vo.id}" data-width="900px">修改上级</a> <a class="layui-btn layui-btn-sm layui-btn-primary" data-iframe="{:url('parent')}?uid={$vo.id}" data-width="900px">修改上级</a>
<!--{/if}--> <!--{/if}-->
<!--{if auth("user_balance/add")}--> <!--{if auth("user_balance/add")}-->
<a class="layui-btn layui-btn-sm layui-btn-primary" data-modal="{:url('user.balance/add')}?uid={$vo.id}" data-title="充值账户余额"> </a> <a class="layui-btn layui-btn-sm layui-btn-primary" data-modal="{:url('user.balance/add')}?uid={$vo.id}" data-title="充值账户余额"> </a>
<!--{/if}--> <!--{/if}-->
<!--{if auth("state") and $vo.status eq 1}--> <!--{if auth("state") and $vo.status eq 1}-->
<a class="layui-btn layui-btn-sm layui-btn-danger" data-action="{:url('state')}" data-confirm="账号冻结后将不能下单和提现,确认吗?" data-value="id#{$vo.id};status#0"> </a> <a class="layui-btn layui-btn-sm layui-btn-danger" data-action="{:url('state')}" data-confirm="账号冻结后不能下单和提现,确定要冻结吗?" data-value="id#{$vo.id};status#0"> </a>
<!--{/if}--> <!--{/if}-->
<!--{if auth("state") and $vo.status eq 0}--> <!--{if auth("state") and $vo.status eq 0}-->
<a class="layui-btn layui-btn-sm layui-btn-normal" data-action="{:url('state')}" data-value="id#{$vo.id};status#1"> </a> <a class="layui-btn layui-btn-sm layui-btn-normal" data-action="{:url('state')}" data-value="id#{$vo.id};status#1"> </a>
<!--{/if}--> <!--{/if}-->
</td> </td>
</tr> </tr>
{/foreach} {/foreach}
</tbody> </tbody>
</table> </table>
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty} {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
</div> </div>
{/block} {/block}

View File

@ -21,10 +21,10 @@
<div class="layui-input-inline"> <div class="layui-input-inline">
<select class="layui-select" name="vip_code"> <select class="layui-select" name="vip_code">
<option value="">-- 全部 --</option> <option value="">-- 全部 --</option>
{foreach $upgrades as $upgrade}{if input('vip_code') eq $upgrade.number} {foreach $upgrades as $upgrade}{if input('vip_code') eq $upgrade.number.''}
<option selected value="{$upgrade.number|default=0}">[ {$upgrade.number|default='0'} ] {$upgrade.name|default=''}</option> <option selected value="{$upgrade.number|default=0}">[ VIP{$upgrade.number|default='0'} ] {$upgrade.name|default=''}</option>
{else} {else}
<option value="{$upgrade.number|default=0}">[ {$upgrade.number|default='0'} ] {$upgrade.name|default=''}</option> <option value="{$upgrade.number|default=0}">[ VIP{$upgrade.number|default='0'} ] {$upgrade.name|default=''}</option>
{/if}{/foreach} {/if}{/foreach}
</select> </select>
</div> </div>
@ -32,29 +32,29 @@
<!--{/notempty}--> <!--{/notempty}-->
<div class="layui-form-item layui-inline"> <div class="layui-form-item layui-inline">
<label class="layui-form-label">推荐人手机</label> <label class="layui-form-label">代理手机</label>
<label class="layui-input-inline"> <label class="layui-input-inline">
<input class="layui-input" name="from_phone" placeholder="请输入推荐人手机" value="{:input('from_phone')}"> <input class="layui-input" name="from_phone" placeholder="请输入代理手机" value="{:input('from_phone')}">
</label> </label>
</div> </div>
<div class="layui-form-item layui-inline"> <div class="layui-form-item layui-inline">
<label class="layui-form-label">推荐人昵称</label> <label class="layui-form-label">代理昵称</label>
<label class="layui-input-inline"> <label class="layui-input-inline">
<input class="layui-input" name="from_username" placeholder="请输入推荐人昵称" value="{:input('from_username')}"> <input class="layui-input" name="from_username" placeholder="请输入代理昵称" value="{:input('from_username')}">
</label> </label>
</div> </div>
<!--{notempty name='upgrades'}--> <!--{notempty name='upgrades'}-->
<div class="layui-form-item layui-inline"> <div class="layui-form-item layui-inline">
<label class="layui-form-label">推荐人等级</label> <label class="layui-form-label">代理等级</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<select class="layui-select" name="from_vipcode"> <select class="layui-select" name="from_vipcode">
<option value="">-- 全部 --</option> <option value="">-- 全部 --</option>
{foreach $upgrades as $upgrade}{if input('from_vipcode') eq $upgrade.number} {foreach $upgrades as $upgrade}{if input('from_vipcode') eq $upgrade.number.''}
<option selected value="{$upgrade.number|default=0}">[ {$upgrade.number|default='0'} ] {$upgrade.name|default=''}</option> <option selected value="{$upgrade.number|default=0}">[ VIP{$upgrade.number|default='0'} ] {$upgrade.name|default=''}</option>
{else} {else}
<option value="{$upgrade.number|default=0}">[ {$upgrade.number|default='0'} ] {$upgrade.name|default=''}</option> <option value="{$upgrade.number|default=0}">[ VIP{$upgrade.number|default='0'} ] {$upgrade.name|default=''}</option>
{/if}{/foreach} {/if}{/foreach}
</select> </select>
</div> </div>

View File

@ -8,7 +8,7 @@
<thead> <thead>
<tr> <tr>
<th class='nowrap'>用户信息</th> <th class='nowrap'>用户信息</th>
<th class='nowrap'>推荐人信息</th> <th class='nowrap'>代理信息</th>
<th class='nowrap'>注册时间</th> <th class='nowrap'>注册时间</th>
<th class='nowrap'></th> <th class='nowrap'></th>
</tr> </tr>
@ -53,7 +53,7 @@
<div>手机:<span>{$vo.from.phone|default='-'}</span></div> <div>手机:<span>{$vo.from.phone|default='-'}</span></div>
</div> </div>
{else} {else}
<div class="color-desc">没有推荐人</div> <div class="color-desc">没有代理</div>
{/notempty} {/notempty}
</td> </td>
<td class="nowrap"> <td class="nowrap">