切换导航条
此项目
正在载入...
登录
李涵
/
integral
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
lihan
6 years ago
提交
96c549ea338dc318fd9589c72fb0dbeb4f4502a8
1 个父辈
c2a39847
1 个管道 的构建
通过
耗费 3 秒
赠送积分和角色管理
变更
1
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
49 行增加
和
32 行删除
app/user/controller/AdminIndexController.php
app/user/controller/AdminIndexController.php
查看文件 @
96c549e
...
...
@@ -56,9 +56,9 @@ class AdminIndexController extends AdminBaseController
*/
public
function
index
()
{
$where
=
[
'user_type'
=>
2
];
$where1
=
[];
$where3
=
[];
$where
=
[
'user_type'
=>
2
];
$where1
=
[];
$where3
=
[];
$param
=
request
()
->
param
();
...
...
@@ -67,53 +67,69 @@ class AdminIndexController extends AdminBaseController
$keyword
=
$param
[
'keyword'
];
$keywordComplex
[
'mobile|id'
]
=
$keyword
;
}
if
(
!
empty
(
$param
[
'start_time'
])){
$where
[
'create_time'
]
=
[
'egt'
,
strtotime
(
$param
[
'start_time'
])];
}
if
(
!
empty
(
$param
[
'end_time'
])){
$where1
[
'create_time'
]
=
[
'elt'
,
strtotime
(
$param
[
'end_time'
])];
if
(
!
empty
(
$param
[
'start_time'
]))
{
$where
[
'create_time'
]
=
[
'egt'
,
strtotime
(
$param
[
'start_time'
])];
}
if
(
!
empty
(
$param
[
'end_time'
]))
{
$where1
[
'create_time'
]
=
[
'elt'
,
strtotime
(
$param
[
'end_time'
])];
}
if
(
!
empty
(
$param
[
'min'
])){
$where
[
'balance'
]
=
[
'egt'
,
$param
[
'min'
]];
if
(
!
empty
(
$param
[
'min'
]))
{
$where
[
'balance'
]
=
[
'egt'
,
$param
[
'min'
]];
}
if
(
!
empty
(
$param
[
'max'
])){
$where1
[
'balance'
]
=
[
'elt'
,
$param
[
'max'
]];
if
(
!
empty
(
$param
[
'max'
]))
{
$where1
[
'balance'
]
=
[
'elt'
,
$param
[
'max'
]];
}
$uid
=
(
isset
(
$param
[
'uid'
]))
?
$param
[
'uid'
]
:
null
;
//下级人员
if
(
$uid
)
{
if
(
$uid
)
{
$where3
[
'parent_id'
]
=
[
'eq'
,
$uid
];
}
$usersQuery
=
Db
::
name
(
'user'
);
$list
=
$usersQuery
->
whereOr
(
$keywordComplex
)
->
where
(
$where
)
->
where
(
$where1
)
->
where
(
$where3
)
->
order
(
"create_time DESC"
)
->
paginate
(
10
);
//获取订单数和会员专区金额统计
foreach
(
$list
as
$k
=>
$item
)
{
$uid
=
$item
[
'id'
];
$role
=
$item
[
'role'
];
$map
=
[
'uid'
=>
[
'eq'
,
$item
[
'id'
]],
'pay_type'
=>
[
'eq'
,
3
],
'step'
=>
[
'neq'
,
1
]
];
$data
=
[];
//如果此人为普通会员,只统计其金额总和
if
(
$role
==
1
)
{
if
(
$role
==
1
)
{
$map
=
[
'uid'
=>
[
'eq'
,
$item
[
'id'
]],
'pay_type'
=>
[
'eq'
,
3
],
'step'
=>
[
'neq'
,
1
]
];
$data
=
Db
::
name
(
'zj_order'
)
->
where
(
$map
)
->
field
(
'sum(whole) as whole,sum(whole_num) as whole_num'
)
->
select
();
$whole
=
$data
[
0
][
'whole'
];
$whole_num
=
$data
[
0
][
'whole_num'
];
$total
=
$whole
-
$whole_num
;
}
else
{
$total
=
'下级'
;
}
else
{
//先查此人的下级
$son_arr
=
Db
::
name
(
'user'
)
->
where
([
'parent_id'
=>
$item
[
'id'
]])
->
field
(
'id'
)
->
select
();
if
(
!
empty
(
$son_arr
))
{
$son_str
=
''
;
foreach
(
$son_arr
as
$k
=>
$v
)
{
if
(
$k
==
count
(
$son_arr
)
-
1
)
{
$son_str
.=
$v
[
'id'
];
}
else
{
$son_str
.=
$v
[
'id'
]
.
','
;
}
}
$map
=
[
'uid'
=>
[
'in'
,
$son_str
],
'pay_type'
=>
[
'eq'
,
3
],
'step'
=>
[
'neq'
,
1
]
];
$data
=
Db
::
name
(
'zj_order'
)
->
where
(
$map
)
->
field
(
'sum(whole) as whole,sum(whole_num) as whole_num'
)
->
select
();
}
}
$whole
=
$data
[
0
][
'whole'
];
$whole_num
=
$data
[
0
][
'whole_num'
];
$total
=
$whole
-
$whole_num
;
$item
[
'total'
]
=
$total
;
$list
[
$k
]
=
$item
;
}
// 获取分页显示
$list
->
appends
(
$param
);
$this
->
assign
(
'start_time'
,
isset
(
$param
[
'start_time'
])
?
$param
[
'start_time'
]
:
''
);
...
...
@@ -183,12 +199,13 @@ class AdminIndexController extends AdminBaseController
/**
* 用户积分详情
*/
public
function
balance
(){
if
(
$this
->
request
->
param
()){
$id
=
input
(
'param.id'
);
$all
=
Db
::
name
(
'zj_integral_log'
)
->
where
(
'uid'
,
$id
)
->
paginate
(
20
);
$this
->
assign
(
'list'
,
$all
);
$this
->
assign
(
'page'
,
$all
->
render
());
public
function
balance
()
{
if
(
$this
->
request
->
param
())
{
$id
=
input
(
'param.id'
);
$all
=
Db
::
name
(
'zj_integral_log'
)
->
where
(
'uid'
,
$id
)
->
paginate
(
20
);
$this
->
assign
(
'list'
,
$all
);
$this
->
assign
(
'page'
,
$all
->
render
());
return
$this
->
fetch
();
}
}
...
...
请
注册
或
登录
后发表评论