Commit 504bf657 by 冷斌

update

parent 27b4e316
......@@ -7,7 +7,7 @@
</ul>
<form class="well form-search" method="post" action="{:U('Customer/index')}">
<!-- <if condition="$isshow">
推广员:
推广员:
<select class="select_2" name="one_id">
<option value="">全部</option>
<volist name="proxys" id="v">
......@@ -15,14 +15,15 @@
</volist>
</select> &nbsp;&nbsp;
</if> -->
客户:
客户:
<input type="text" name="keyword" style="width: 200px;" value="{$formget.keyword}" placeholder="请输入客户用户名、昵称...">
<input type="submit" class="btn btn-primary" value="搜索">
</form>
</form>
<table class="table table-hover table-bordered">
<thead>
<tr>
<th width="50">ID</th>
<th>推广员</th>
<th>用户名</th>
<th>昵称</th>
<th>用户总充值金额</th>
......@@ -35,6 +36,7 @@
<foreach name="users" item="vo">
<tr>
<td>{$vo.id}</td>
<td>{$vo.lv}</td>
<td>{$vo.user_login}</td>
<td>{$vo.user_nicename}</td>
<td>{$vo.total_charge}</td>
......@@ -49,4 +51,4 @@
</div>
<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>
\ No newline at end of file
</html>
......@@ -4,7 +4,7 @@ namespace Admin\Controller;
use Common\Controller\AdminbaseController;
class CustomerController extends AdminbaseController{
protected $users_model,$role_model;
function _initialize() {
parent::_initialize();
$this->users_model = D("Common/Users");
......@@ -22,23 +22,23 @@ class CustomerController extends AdminbaseController{
$user = $this->users_model->where("id={$_SESSION['ADMIN_ID']}")->find();
if($user['tg_type'] == 0){//平台方
}elseif($user['tg_type'] == 2){//一级代理
$path=setpath($user['id']);
$uids=$Proxy->where("type=0 and path like '%{$path}%'")->getField('uid',true);
if($uids){
$where["id"] = array('in',$uids);
}else{
$where["id"] = array('in',array('0'));
}
}elseif($user['tg_type'] == 3){//二级代理
$path=setpath($user['id']);
$uids=$Proxy->where("type=0 and path like '%{$path}%'")->getField('uid',true);
if($uids){
$where["id"] = array('in',$uids);
}else{
......@@ -47,7 +47,7 @@ class CustomerController extends AdminbaseController{
}elseif($user['tg_type'] == 4){//主播
$path=setpath($user['id']);
$uids=$Proxy->where("type=0 and path like '%{$path}%'")->getField('uid',true);
if($uids){
$where["id"] = array('in',$uids);
}else{
......@@ -56,7 +56,7 @@ class CustomerController extends AdminbaseController{
}elseif($user['tg_type'] == 5){//业务员
$path=setpath($user['id']);
$uids=$Proxy->where("type=0 and path like '%{$path}%'")->getField('uid',true);
if($uids){
$where["id"] = array('in',$uids);
}else{
......@@ -69,7 +69,7 @@ class CustomerController extends AdminbaseController{
// $isshow=1;
// }
// $this->assign("isshow",$isshow);
// $adminid=$_SESSION['ADMIN_ID'];
// $one_id=$adminid;
// if($_REQUEST['one_id']!=''){
......@@ -94,7 +94,7 @@ class CustomerController extends AdminbaseController{
// }
// $where['id'] = array('in',$uids);
/* 客户列表 */
$count=M('users')->where($where)->count();
$page = $this->page($count, 20);
......@@ -115,7 +115,7 @@ class CustomerController extends AdminbaseController{
$total_charge='0';
}
$v['total_charge']=$total_charge;
$map2=[];
$map2['uid'] = $v['id'];
$total_votes=$Votes->where("type='income'")->where($map2)->sum('votes');
......@@ -124,15 +124,32 @@ class CustomerController extends AdminbaseController{
}
$v['total_votes']=$total_votes;
$proxy = M('users_proxy')
->field('path')
->where(['uid'=>$v['uid']])
->select();
$lv = '平台';
if (!empty($proxy[0]['path'])) {
$path2 = array_filter(explode(';', $proxy[0]['path']));
$uuid = array_pop($path2);
$uuinfo = getUserInfo($uuid);
$lv = $uuinfo['user_nicename'];
if ($lv === '用户不存在') {
$lv = '平台';
}
}
$lists[$k]['lv']= $lv;
$users[$k]=$v;
}
/* 推广员列表 */
// $where_p=[];
// $where_p['u.user_type']='1';
// $where_p['r.role_id']='7';
// if($admin_roleid==6 ){
// $path=setpath($adminid);
// $uids=$Proxy->where("type = -1 and path like '%{$path}%'")->getField('uid',true);
......@@ -157,13 +174,13 @@ class CustomerController extends AdminbaseController{
// $proxys[$k]=$v;
// }
// $this->assign("proxys",$proxys);
$this->assign('formget', $_GET);
$this->assign("page", $page->show('Admin'));
$this->assign("users",$users);
$this->display();
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment