Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
haishi
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冷斌
haishi
Commits
504bf657
Commit
504bf657
authored
Apr 29, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
27b4e316
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
25 deletions
+42
-25
admin/themes/simplebootx/Admin/Customer/index.html
+6
-5
application/Admin/Controller/CustomerController.class.php
+36
-20
No files found.
admin/themes/simplebootx/Admin/Customer/index.html
View file @
504bf657
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
</ul>
</ul>
<form
class=
"well form-search"
method=
"post"
action=
"{:U('Customer/index')}"
>
<form
class=
"well form-search"
method=
"post"
action=
"{:U('Customer/index')}"
>
<!-- <if condition="$isshow">
<!-- <if condition="$isshow">
推广员:
推广员:
<select class="select_2" name="one_id">
<select class="select_2" name="one_id">
<option value="">全部</option>
<option value="">全部</option>
<volist name="proxys" id="v">
<volist name="proxys" id="v">
...
@@ -15,14 +15,15 @@
...
@@ -15,14 +15,15 @@
</volist>
</volist>
</select>
</select>
</if> -->
</if> -->
客户:
客户:
<input
type=
"text"
name=
"keyword"
style=
"width: 200px;"
value=
"{$formget.keyword}"
placeholder=
"请输入客户用户名、昵称..."
>
<input
type=
"text"
name=
"keyword"
style=
"width: 200px;"
value=
"{$formget.keyword}"
placeholder=
"请输入客户用户名、昵称..."
>
<input
type=
"submit"
class=
"btn btn-primary"
value=
"搜索"
>
<input
type=
"submit"
class=
"btn btn-primary"
value=
"搜索"
>
</form>
</form>
<table
class=
"table table-hover table-bordered"
>
<table
class=
"table table-hover table-bordered"
>
<thead>
<thead>
<tr>
<tr>
<th
width=
"50"
>
ID
</th>
<th
width=
"50"
>
ID
</th>
<th>
推广员
</th>
<th>
用户名
</th>
<th>
用户名
</th>
<th>
昵称
</th>
<th>
昵称
</th>
<th>
用户总充值金额
</th>
<th>
用户总充值金额
</th>
...
@@ -35,6 +36,7 @@
...
@@ -35,6 +36,7 @@
<foreach
name=
"users"
item=
"vo"
>
<foreach
name=
"users"
item=
"vo"
>
<tr>
<tr>
<td>
{$vo.id}
</td>
<td>
{$vo.id}
</td>
<td>
{$vo.lv}
</td>
<td>
{$vo.user_login}
</td>
<td>
{$vo.user_login}
</td>
<td>
{$vo.user_nicename}
</td>
<td>
{$vo.user_nicename}
</td>
<td>
{$vo.total_charge}
</td>
<td>
{$vo.total_charge}
</td>
...
@@ -49,4 +51,4 @@
...
@@ -49,4 +51,4 @@
</div>
</div>
<script
src=
"__PUBLIC__/js/common.js"
></script>
<script
src=
"__PUBLIC__/js/common.js"
></script>
</body>
</body>
</html>
</html>
\ No newline at end of file
application/Admin/Controller/CustomerController.class.php
View file @
504bf657
...
@@ -4,7 +4,7 @@ namespace Admin\Controller;
...
@@ -4,7 +4,7 @@ namespace Admin\Controller;
use
Common\Controller\AdminbaseController
;
use
Common\Controller\AdminbaseController
;
class
CustomerController
extends
AdminbaseController
{
class
CustomerController
extends
AdminbaseController
{
protected
$users_model
,
$role_model
;
protected
$users_model
,
$role_model
;
function
_initialize
()
{
function
_initialize
()
{
parent
::
_initialize
();
parent
::
_initialize
();
$this
->
users_model
=
D
(
"Common/Users"
);
$this
->
users_model
=
D
(
"Common/Users"
);
...
@@ -22,23 +22,23 @@ class CustomerController extends AdminbaseController{
...
@@ -22,23 +22,23 @@ class CustomerController extends AdminbaseController{
$user
=
$this
->
users_model
->
where
(
"id=
{
$_SESSION
[
'ADMIN_ID'
]
}
"
)
->
find
();
$user
=
$this
->
users_model
->
where
(
"id=
{
$_SESSION
[
'ADMIN_ID'
]
}
"
)
->
find
();
if
(
$user
[
'tg_type'
]
==
0
){
//平台方
if
(
$user
[
'tg_type'
]
==
0
){
//平台方
}
elseif
(
$user
[
'tg_type'
]
==
2
){
//一级代理
}
elseif
(
$user
[
'tg_type'
]
==
2
){
//一级代理
$path
=
setpath
(
$user
[
'id'
]);
$path
=
setpath
(
$user
[
'id'
]);
$uids
=
$Proxy
->
where
(
"type=0 and path like '%
{
$path
}
%'"
)
->
getField
(
'uid'
,
true
);
$uids
=
$Proxy
->
where
(
"type=0 and path like '%
{
$path
}
%'"
)
->
getField
(
'uid'
,
true
);
if
(
$uids
){
if
(
$uids
){
$where
[
"id"
]
=
array
(
'in'
,
$uids
);
$where
[
"id"
]
=
array
(
'in'
,
$uids
);
}
else
{
}
else
{
$where
[
"id"
]
=
array
(
'in'
,
array
(
'0'
));
$where
[
"id"
]
=
array
(
'in'
,
array
(
'0'
));
}
}
}
elseif
(
$user
[
'tg_type'
]
==
3
){
//二级代理
}
elseif
(
$user
[
'tg_type'
]
==
3
){
//二级代理
$path
=
setpath
(
$user
[
'id'
]);
$path
=
setpath
(
$user
[
'id'
]);
$uids
=
$Proxy
->
where
(
"type=0 and path like '%
{
$path
}
%'"
)
->
getField
(
'uid'
,
true
);
$uids
=
$Proxy
->
where
(
"type=0 and path like '%
{
$path
}
%'"
)
->
getField
(
'uid'
,
true
);
if
(
$uids
){
if
(
$uids
){
$where
[
"id"
]
=
array
(
'in'
,
$uids
);
$where
[
"id"
]
=
array
(
'in'
,
$uids
);
}
else
{
}
else
{
...
@@ -47,7 +47,7 @@ class CustomerController extends AdminbaseController{
...
@@ -47,7 +47,7 @@ class CustomerController extends AdminbaseController{
}
elseif
(
$user
[
'tg_type'
]
==
4
){
//主播
}
elseif
(
$user
[
'tg_type'
]
==
4
){
//主播
$path
=
setpath
(
$user
[
'id'
]);
$path
=
setpath
(
$user
[
'id'
]);
$uids
=
$Proxy
->
where
(
"type=0 and path like '%
{
$path
}
%'"
)
->
getField
(
'uid'
,
true
);
$uids
=
$Proxy
->
where
(
"type=0 and path like '%
{
$path
}
%'"
)
->
getField
(
'uid'
,
true
);
if
(
$uids
){
if
(
$uids
){
$where
[
"id"
]
=
array
(
'in'
,
$uids
);
$where
[
"id"
]
=
array
(
'in'
,
$uids
);
}
else
{
}
else
{
...
@@ -56,7 +56,7 @@ class CustomerController extends AdminbaseController{
...
@@ -56,7 +56,7 @@ class CustomerController extends AdminbaseController{
}
elseif
(
$user
[
'tg_type'
]
==
5
){
//业务员
}
elseif
(
$user
[
'tg_type'
]
==
5
){
//业务员
$path
=
setpath
(
$user
[
'id'
]);
$path
=
setpath
(
$user
[
'id'
]);
$uids
=
$Proxy
->
where
(
"type=0 and path like '%
{
$path
}
%'"
)
->
getField
(
'uid'
,
true
);
$uids
=
$Proxy
->
where
(
"type=0 and path like '%
{
$path
}
%'"
)
->
getField
(
'uid'
,
true
);
if
(
$uids
){
if
(
$uids
){
$where
[
"id"
]
=
array
(
'in'
,
$uids
);
$where
[
"id"
]
=
array
(
'in'
,
$uids
);
}
else
{
}
else
{
...
@@ -69,7 +69,7 @@ class CustomerController extends AdminbaseController{
...
@@ -69,7 +69,7 @@ class CustomerController extends AdminbaseController{
// $isshow=1;
// $isshow=1;
// }
// }
// $this->assign("isshow",$isshow);
// $this->assign("isshow",$isshow);
// $adminid=$_SESSION['ADMIN_ID'];
// $adminid=$_SESSION['ADMIN_ID'];
// $one_id=$adminid;
// $one_id=$adminid;
// if($_REQUEST['one_id']!=''){
// if($_REQUEST['one_id']!=''){
...
@@ -94,7 +94,7 @@ class CustomerController extends AdminbaseController{
...
@@ -94,7 +94,7 @@ class CustomerController extends AdminbaseController{
// }
// }
// $where['id'] = array('in',$uids);
// $where['id'] = array('in',$uids);
/* 客户列表 */
/* 客户列表 */
$count
=
M
(
'users'
)
->
where
(
$where
)
->
count
();
$count
=
M
(
'users'
)
->
where
(
$where
)
->
count
();
$page
=
$this
->
page
(
$count
,
20
);
$page
=
$this
->
page
(
$count
,
20
);
...
@@ -115,7 +115,7 @@ class CustomerController extends AdminbaseController{
...
@@ -115,7 +115,7 @@ class CustomerController extends AdminbaseController{
$total_charge
=
'0'
;
$total_charge
=
'0'
;
}
}
$v
[
'total_charge'
]
=
$total_charge
;
$v
[
'total_charge'
]
=
$total_charge
;
$map2
=
[];
$map2
=
[];
$map2
[
'uid'
]
=
$v
[
'id'
];
$map2
[
'uid'
]
=
$v
[
'id'
];
$total_votes
=
$Votes
->
where
(
"type='income'"
)
->
where
(
$map2
)
->
sum
(
'votes'
);
$total_votes
=
$Votes
->
where
(
"type='income'"
)
->
where
(
$map2
)
->
sum
(
'votes'
);
...
@@ -124,15 +124,32 @@ class CustomerController extends AdminbaseController{
...
@@ -124,15 +124,32 @@ class CustomerController extends AdminbaseController{
}
}
$v
[
'total_votes'
]
=
$total_votes
;
$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
;
$users
[
$k
]
=
$v
;
}
}
/* 推广员列表 */
/* 推广员列表 */
// $where_p=[];
// $where_p=[];
// $where_p['u.user_type']='1';
// $where_p['u.user_type']='1';
// $where_p['r.role_id']='7';
// $where_p['r.role_id']='7';
// if($admin_roleid==6 ){
// if($admin_roleid==6 ){
// $path=setpath($adminid);
// $path=setpath($adminid);
// $uids=$Proxy->where("type = -1 and path like '%{$path}%'")->getField('uid',true);
// $uids=$Proxy->where("type = -1 and path like '%{$path}%'")->getField('uid',true);
...
@@ -157,13 +174,13 @@ class CustomerController extends AdminbaseController{
...
@@ -157,13 +174,13 @@ class CustomerController extends AdminbaseController{
// $proxys[$k]=$v;
// $proxys[$k]=$v;
// }
// }
// $this->assign("proxys",$proxys);
// $this->assign("proxys",$proxys);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"users"
,
$users
);
$this
->
assign
(
"users"
,
$users
);
$this
->
display
();
$this
->
display
();
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment