Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
xiaozhan
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
冷斌
xiaozhan
Commits
adc15add
Commit
adc15add
authored
Mar 18, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
55f9bf67
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
276 additions
and
278 deletions
+276
-278
application/Admin/Controller/CashController.class.php
+2
-2
application/Admin/Controller/ChargeController.class.php
+47
-47
application/Admin/Controller/FeedbackController.class.php
+39
-39
application/Admin/Controller/LiveController.class.php
+19
-19
application/Admin/Controller/LivebanController.class.php
+15
-15
application/Admin/Controller/LivekickController.class.php
+15
-15
application/Admin/Controller/ManualController.class.php
+27
-27
application/Admin/Controller/SettlechargeController.class.php
+55
-56
application/Admin/Controller/SettlevotesController.class.php
+54
-55
application/Admin/Controller/UserauthController.class.php
+3
-3
No files found.
application/Admin/Controller/CashController.class.php
View file @
adc15add
...
@@ -30,7 +30,7 @@ class CashController extends AdminbaseController {
...
@@ -30,7 +30,7 @@ class CashController extends AdminbaseController {
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])));
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
]
.
' 23:59:59'
)));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
...
@@ -148,7 +148,7 @@ class CashController extends AdminbaseController {
...
@@ -148,7 +148,7 @@ class CashController extends AdminbaseController {
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])));
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
]
.
' 23:59:59'
)));
}
}
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
$map
[
'uid|orderno|trade_no'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
$map
[
'uid|orderno|trade_no'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
...
...
application/Admin/Controller/ChargeController.class.php
View file @
adc15add
...
@@ -32,15 +32,15 @@ class ChargeController extends AdminbaseController {
...
@@ -32,15 +32,15 @@ class ChargeController extends AdminbaseController {
$isshowset
=
0
;
$isshowset
=
0
;
}
}
$this
->
assign
(
'isshowset'
,
$isshowset
);
$this
->
assign
(
'isshowset'
,
$isshowset
);
$Proxy
=
M
(
'users_proxy'
);
$Proxy
=
M
(
'users_proxy'
);
/* 代理业务员 */
/* 代理业务员 */
$showlevel
=
'0'
;
$showlevel
=
'0'
;
if
(
$role_id
==
6
){
//一级代理
if
(
$role_id
==
6
){
//一级代理
$showlevel
=
'1'
;
$showlevel
=
'1'
;
$where
[
'u.user_type'
]
=
'1'
;
$where
[
'u.user_type'
]
=
'1'
;
$where
[
'r.role_id'
]
=
'7'
;
$where
[
'r.role_id'
]
=
'7'
;
$path
=
setpath
(
$adminid
);
$path
=
setpath
(
$adminid
);
...
@@ -50,7 +50,7 @@ class ChargeController extends AdminbaseController {
...
@@ -50,7 +50,7 @@ class ChargeController extends AdminbaseController {
array_push
(
$uids
,
'0'
);
array_push
(
$uids
,
'0'
);
}
}
$where
[
'u.id'
]
=
array
(
'in'
,
$uids
);
$where
[
'u.id'
]
=
array
(
'in'
,
$uids
);
$promoterlist
=
M
(
'users u'
)
$promoterlist
=
M
(
'users u'
)
->
join
(
'__ROLE_USER__ r ON r.user_id = u.id'
)
->
join
(
'__ROLE_USER__ r ON r.user_id = u.id'
)
->
field
(
'u.id,u.user_login,user_nicename'
)
->
field
(
'u.id,u.user_login,user_nicename'
)
...
@@ -68,7 +68,7 @@ class ChargeController extends AdminbaseController {
...
@@ -68,7 +68,7 @@ class ChargeController extends AdminbaseController {
}
else
if
(
$role_id
==
7
){
//业务员
}
else
if
(
$role_id
==
7
){
//业务员
$showlevel
=
'2'
;
$showlevel
=
'2'
;
}
else
if
(
$role_id
==
9
){
//主播
}
else
if
(
$role_id
==
9
){
//主播
$where
[
'u.user_type'
]
=
'1'
;
$where
[
'u.user_type'
]
=
'1'
;
$where
[
'r.role_id'
]
=
'6'
;
$where
[
'r.role_id'
]
=
'6'
;
$proxylistj
=
[];
$proxylistj
=
[];
...
@@ -105,25 +105,25 @@ class ChargeController extends AdminbaseController {
...
@@ -105,25 +105,25 @@ class ChargeController extends AdminbaseController {
}
}
$v
[
'list'
]
=
$promoterlistj
;
$v
[
'list'
]
=
$promoterlistj
;
$proxylistj
[
$v
[
'id'
]]
=
$v
;
$proxylistj
[
$v
[
'id'
]]
=
$v
;
}
}
}
}
$this
->
assign
(
'proxylistj'
,
json_encode
(
$proxylistj
));
$this
->
assign
(
'proxylistj'
,
json_encode
(
$proxylistj
));
$this
->
assign
(
'promoterlist'
,
$promoterlist
);
$this
->
assign
(
'promoterlist'
,
$promoterlist
);
$this
->
assign
(
'showlevel'
,
$showlevel
);
$this
->
assign
(
'showlevel'
,
$showlevel
);
if
(
$role_id
==
6
||
$role_id
==
7
||
$role_id
==
8
||
$role_id
==
9
||
$_REQUEST
[
'proxyid'
]
!=
''
||
$_REQUEST
[
'promoterid'
]
!=
''
){
if
(
$role_id
==
6
||
$role_id
==
7
||
$role_id
==
8
||
$role_id
==
9
||
$_REQUEST
[
'proxyid'
]
!=
''
||
$_REQUEST
[
'promoterid'
]
!=
''
){
if
(
$_REQUEST
[
'proxyid'
]
!=
''
){
if
(
$_REQUEST
[
'proxyid'
]
!=
''
){
$adminid
=
$_REQUEST
[
'proxyid'
];
$adminid
=
$_REQUEST
[
'proxyid'
];
$_GET
[
'proxyid'
]
=
$_REQUEST
[
'proxyid'
];
$_GET
[
'proxyid'
]
=
$_REQUEST
[
'proxyid'
];
}
}
if
(
$_REQUEST
[
'promoterid'
]
!=
''
){
if
(
$_REQUEST
[
'promoterid'
]
!=
''
){
$adminid
=
$_REQUEST
[
'promoterid'
];
$adminid
=
$_REQUEST
[
'promoterid'
];
$_GET
[
'promoterid'
]
=
$_REQUEST
[
'promoterid'
];
$_GET
[
'promoterid'
]
=
$_REQUEST
[
'promoterid'
];
}
}
$path
=
setpath
(
$adminid
);
$path
=
setpath
(
$adminid
);
$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
){
...
@@ -132,7 +132,7 @@ class ChargeController extends AdminbaseController {
...
@@ -132,7 +132,7 @@ class ChargeController extends AdminbaseController {
}
}
$map
[
'uid'
]
=
array
(
'in'
,
$uids
);
$map
[
'uid'
]
=
array
(
'in'
,
$uids
);
}
}
if
(
$_REQUEST
[
'status'
]
!=
''
){
if
(
$_REQUEST
[
'status'
]
!=
''
){
$map
[
'status'
]
=
$_REQUEST
[
'status'
];
$map
[
'status'
]
=
$_REQUEST
[
'status'
];
$_GET
[
'status'
]
=
$_REQUEST
[
'status'
];
$_GET
[
'status'
]
=
$_REQUEST
[
'status'
];
...
@@ -141,21 +141,21 @@ class ChargeController extends AdminbaseController {
...
@@ -141,21 +141,21 @@ class ChargeController extends AdminbaseController {
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
}
}
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])));
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
]
.
' 23:59:59'
)));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
$map
[
'uid|orderno|trade_no'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
$map
[
'uid|orderno|trade_no'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
$_GET
[
'keyword'
]
=
$_REQUEST
[
'keyword'
];
$_GET
[
'keyword'
]
=
$_REQUEST
[
'keyword'
];
}
}
...
@@ -167,68 +167,68 @@ class ChargeController extends AdminbaseController {
...
@@ -167,68 +167,68 @@ class ChargeController extends AdminbaseController {
->
order
(
"addtime DESC"
)
->
order
(
"addtime DESC"
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
select
();
->
select
();
$moneysum
=
$charge
$moneysum
=
$charge
->
where
(
$map
)
->
where
(
$map
)
->
sum
(
"money"
);
->
sum
(
"money"
);
foreach
(
$lists
as
$k
=>
$v
){
foreach
(
$lists
as
$k
=>
$v
){
$userinfo
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
$v[uid]
'"
)
->
find
();
$userinfo
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
$v[uid]
'"
)
->
find
();
$lists
[
$k
][
'userinfo'
]
=
$userinfo
;
$lists
[
$k
][
'userinfo'
]
=
$userinfo
;
}
}
$this
->
assign
(
'moneysum'
,
$moneysum
);
$this
->
assign
(
'moneysum'
,
$moneysum
);
$this
->
assign
(
'lists'
,
$lists
);
$this
->
assign
(
'lists'
,
$lists
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
'status'
,
$this
->
status
);
$this
->
assign
(
'status'
,
$this
->
status
);
$this
->
assign
(
'type'
,
$this
->
type
);
$this
->
assign
(
'type'
,
$this
->
type
);
$this
->
assign
(
'ambient'
,
$this
->
ambient
);
$this
->
assign
(
'ambient'
,
$this
->
ambient
);
$this
->
display
();
$this
->
display
();
}
}
function
setPay
(){
function
setPay
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
){
if
(
$id
){
$result
=
M
(
"users_charge"
)
->
where
(
"id=
{
$id
}
and status=0"
)
->
find
();
$result
=
M
(
"users_charge"
)
->
where
(
"id=
{
$id
}
and status=0"
)
->
find
();
if
(
$result
){
if
(
$result
){
/* 更新会员虚拟币 */
/* 更新会员虚拟币 */
$coin
=
$result
[
'coin'
]
+
$result
[
'coin_give'
];
$coin
=
$result
[
'coin'
]
+
$result
[
'coin_give'
];
M
(
"users"
)
->
where
(
"id='
{
$result
[
'touid'
]
}
'"
)
->
setInc
(
"coin"
,
$coin
);
M
(
"users"
)
->
where
(
"id='
{
$result
[
'touid'
]
}
'"
)
->
setInc
(
"coin"
,
$coin
);
/* 更新 订单状态 */
/* 更新 订单状态 */
M
(
"users_charge"
)
->
where
(
"id='
{
$result
[
'id'
]
}
'"
)
->
save
(
array
(
"status"
=>
1
));
M
(
"users_charge"
)
->
where
(
"id='
{
$result
[
'id'
]
}
'"
)
->
save
(
array
(
"status"
=>
1
));
$action
=
"确认充值:
{
$id
}
"
;
$action
=
"确认充值:
{
$id
}
"
;
setAdminLog
(
$action
);
setAdminLog
(
$action
);
$this
->
success
(
'操作成功'
);
$this
->
success
(
'操作成功'
);
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
function
del
(){
function
del
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
){
if
(
$id
){
$result
=
M
(
"users_charge"
)
->
delete
(
$id
);
$result
=
M
(
"users_charge"
)
->
delete
(
$id
);
if
(
$result
){
if
(
$result
){
$action
=
"删除充值记录:
{
$id
}
"
;
$action
=
"删除充值记录:
{
$id
}
"
;
setAdminLog
(
$action
);
setAdminLog
(
$action
);
$this
->
success
(
'删除成功'
);
$this
->
success
(
'删除成功'
);
}
else
{
}
else
{
$this
->
error
(
'删除失败'
);
$this
->
error
(
'删除失败'
);
}
}
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
$this
->
display
();
$this
->
display
();
}
}
function
export
()
function
export
()
{
{
...
@@ -237,15 +237,15 @@ class ChargeController extends AdminbaseController {
...
@@ -237,15 +237,15 @@ class ChargeController extends AdminbaseController {
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
}
}
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])));
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
]
.
' 23:59:59'
)));
}
}
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
$map
[
'uid|orderno|trade_no'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
$map
[
'uid|orderno|trade_no'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
}
}
$xlsName
=
"Excel"
;
$xlsName
=
"Excel"
;
$charge
=
M
(
"users_charge"
);
$charge
=
M
(
"users_charge"
);
...
@@ -254,13 +254,13 @@ class ChargeController extends AdminbaseController {
...
@@ -254,13 +254,13 @@ class ChargeController extends AdminbaseController {
{
{
$userinfo
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
$v[uid]
'"
)
->
find
();
$userinfo
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
$v[uid]
'"
)
->
find
();
$xlsData
[
$k
][
'user_nicename'
]
=
$userinfo
[
'user_nicename'
]
.
"("
.
$v
[
'uid'
]
.
")"
;
$xlsData
[
$k
][
'user_nicename'
]
=
$userinfo
[
'user_nicename'
]
.
"("
.
$v
[
'uid'
]
.
")"
;
$xlsData
[
$k
][
'addtime'
]
=
date
(
"Y-m-d H:i:s"
,
$v
[
'addtime'
]);
$xlsData
[
$k
][
'addtime'
]
=
date
(
"Y-m-d H:i:s"
,
$v
[
'addtime'
]);
$xlsData
[
$k
][
'type'
]
=
$this
->
type
[
$v
[
'type'
]];
$xlsData
[
$k
][
'type'
]
=
$this
->
type
[
$v
[
'type'
]];
$xlsData
[
$k
][
'status'
]
=
$this
->
status
[
$v
[
'status'
]];
$xlsData
[
$k
][
'status'
]
=
$this
->
status
[
$v
[
'status'
]];
//if($v['type']=='1'){ $xlsData[$k]['type']="支付宝";}else if( $xlsData[$k]['type']=='2'){ $xlsData[$k]['type']="微信";}else{ $xlsData[$k]['type']="苹果支付";}
//if($v['type']=='1'){ $xlsData[$k]['type']="支付宝";}else if( $xlsData[$k]['type']=='2'){ $xlsData[$k]['type']="微信";}else{ $xlsData[$k]['type']="苹果支付";}
//if($v['status']=='0'){ $xlsData[$k]['status']="未支付";}else{ $xlsData[$k]['status']="已完成";}
//if($v['status']=='0'){ $xlsData[$k]['status']="未支付";}else{ $xlsData[$k]['status']="已完成";}
}
}
$action
=
"导出充值记录:"
.
M
(
"users_charge"
)
->
getLastSql
();
$action
=
"导出充值记录:"
.
M
(
"users_charge"
)
->
getLastSql
();
setAdminLog
(
$action
);
setAdminLog
(
$action
);
$cellName
=
array
(
'A'
,
'B'
,
'C'
,
'D'
,
'E'
,
'F'
,
'G'
,
'H'
,
'I'
,
'J'
);
$cellName
=
array
(
'A'
,
'B'
,
'C'
,
'D'
,
'E'
,
'F'
,
'G'
,
'H'
,
'I'
,
'J'
);
...
...
application/Admin/Controller/FeedbackController.class.php
View file @
adc15add
...
@@ -16,24 +16,24 @@ class FeedbackController extends AdminbaseController {
...
@@ -16,24 +16,24 @@ class FeedbackController extends AdminbaseController {
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
}
}
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])));
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
]
.
' 23:59:59'
)));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
$map
[
'uid'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
$map
[
'uid'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
$_GET
[
'keyword'
]
=
$_REQUEST
[
'keyword'
];
$_GET
[
'keyword'
]
=
$_REQUEST
[
'keyword'
];
}
}
$feedback
=
M
(
"feedback"
);
$feedback
=
M
(
"feedback"
);
$count
=
$feedback
->
where
(
$map
)
->
count
();
$count
=
$feedback
->
where
(
$map
)
->
count
();
$page
=
$this
->
page
(
$count
,
20
);
$page
=
$this
->
page
(
$count
,
20
);
...
@@ -42,83 +42,83 @@ class FeedbackController extends AdminbaseController {
...
@@ -42,83 +42,83 @@ class FeedbackController extends AdminbaseController {
->
order
(
"addtime DESC"
)
->
order
(
"addtime DESC"
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
select
();
->
select
();
foreach
(
$lists
as
$k
=>
$v
){
foreach
(
$lists
as
$k
=>
$v
){
$userinfo
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
$v[uid]
'"
)
->
find
();
$userinfo
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
$v[uid]
'"
)
->
find
();
$lists
[
$k
][
'userinfo'
]
=
$userinfo
;
$lists
[
$k
][
'userinfo'
]
=
$userinfo
;
}
}
$this
->
assign
(
'lists'
,
$lists
);
$this
->
assign
(
'lists'
,
$lists
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
display
();
$this
->
display
();
}
}
function
setstatus
(){
function
setstatus
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
){
if
(
$id
){
$data
[
'status'
]
=
1
;
$data
[
'status'
]
=
1
;
$data
[
'uptime'
]
=
time
();
$data
[
'uptime'
]
=
time
();
$result
=
M
(
"feedback"
)
->
where
(
"id='
{
$id
}
'"
)
->
save
(
$data
);
$result
=
M
(
"feedback"
)
->
where
(
"id='
{
$id
}
'"
)
->
save
(
$data
);
if
(
$result
){
if
(
$result
){
$action
=
"用户反馈标记处理:
{
$id
}
"
;
$action
=
"用户反馈标记处理:
{
$id
}
"
;
setAdminLog
(
$action
);
setAdminLog
(
$action
);
$this
->
success
(
'标记成功'
);
$this
->
success
(
'标记成功'
);
}
else
{
}
else
{
$this
->
error
(
'标记失败'
);
$this
->
error
(
'标记失败'
);
}
}
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
function
del
(){
function
del
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
){
if
(
$id
){
$result
=
M
(
"feedback"
)
->
delete
(
$id
);
$result
=
M
(
"feedback"
)
->
delete
(
$id
);
if
(
$result
){
if
(
$result
){
$action
=
"删除用户反馈:
{
$id
}
"
;
$action
=
"删除用户反馈:
{
$id
}
"
;
setAdminLog
(
$action
);
setAdminLog
(
$action
);
$this
->
success
(
'删除成功'
);
$this
->
success
(
'删除成功'
);
}
else
{
}
else
{
$this
->
error
(
'删除失败'
);
$this
->
error
(
'删除失败'
);
}
}
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
function
edit
(){
function
edit
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
){
if
(
$id
){
$feedback
=
M
(
"feedback"
)
->
find
(
$id
);
$feedback
=
M
(
"feedback"
)
->
find
(
$id
);
$feedback
[
'userinfo'
]
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
$feedback[uid]
'"
)
->
find
();
$feedback
[
'userinfo'
]
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
$feedback[uid]
'"
)
->
find
();
$this
->
assign
(
'feedback'
,
$feedback
);
$this
->
assign
(
'feedback'
,
$feedback
);
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
$this
->
display
();
$this
->
display
();
}
}
function
edit_post
(){
function
edit_post
(){
if
(
IS_POST
){
if
(
IS_POST
){
if
(
$_POST
[
'status'
]
==
'0'
){
if
(
$_POST
[
'status'
]
==
'0'
){
$this
->
error
(
'未修改状态'
);
$this
->
error
(
'未修改状态'
);
}
}
$feedback
=
M
(
"feedback"
);
$feedback
=
M
(
"feedback"
);
$feedback
->
create
();
$feedback
->
create
();
$feedback
->
uptime
=
time
();
$feedback
->
uptime
=
time
();
$result
=
$feedback
->
save
();
$result
=
$feedback
->
save
();
if
(
$result
){
if
(
$result
){
$this
->
success
(
'修改成功'
,
U
(
'Userfeedback/index'
));
$this
->
success
(
'修改成功'
,
U
(
'Userfeedback/index'
));
}
else
{
}
else
{
$this
->
error
(
'修改失败'
);
$this
->
error
(
'修改失败'
);
}
}
}
}
}
}
}
}
application/Admin/Controller/LiveController.class.php
View file @
adc15add
...
@@ -9,31 +9,31 @@ class LiveController extends AdminbaseController {
...
@@ -9,31 +9,31 @@ class LiveController extends AdminbaseController {
function
index
(){
function
index
(){
$config
=
getConfigPub
();
$config
=
getConfigPub
();
$map
=
array
();
$map
=
array
();
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
$map
[
'starttime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$map
[
'starttime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
}
}
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'starttime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$map
[
'starttime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'starttime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])));
$map
[
'starttime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
]
.
' 23:59:59'
)));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
$map
[
'uid'
]
=
$_REQUEST
[
'keyword'
];
$map
[
'uid'
]
=
$_REQUEST
[
'keyword'
];
$_GET
[
'keyword'
]
=
$_REQUEST
[
'keyword'
];
$_GET
[
'keyword'
]
=
$_REQUEST
[
'keyword'
];
}
}
$live
=
M
(
"users_liverecord"
);
$live
=
M
(
"users_liverecord"
);
$count
=
$live
->
where
(
$map
)
->
count
();
$count
=
$live
->
where
(
$map
)
->
count
();
$page
=
$this
->
page
(
$count
,
20
);
$page
=
$this
->
page
(
$count
,
20
);
...
@@ -42,33 +42,33 @@ class LiveController extends AdminbaseController {
...
@@ -42,33 +42,33 @@ class LiveController extends AdminbaseController {
->
order
(
"id DESC"
)
->
order
(
"id DESC"
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
select
();
->
select
();
foreach
(
$lists
as
$k
=>
$v
){
foreach
(
$lists
as
$k
=>
$v
){
$userinfo
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
{
$v
[
'uid'
]
}
'"
)
->
find
();
$userinfo
=
M
(
"users"
)
->
field
(
"user_nicename"
)
->
where
(
"id='
{
$v
[
'uid'
]
}
'"
)
->
find
();
$lists
[
$k
][
'userinfo'
]
=
$userinfo
;
$lists
[
$k
][
'userinfo'
]
=
$userinfo
;
}
}
$this
->
assign
(
'config'
,
$config
);
$this
->
assign
(
'config'
,
$config
);
$this
->
assign
(
'lists'
,
$lists
);
$this
->
assign
(
'lists'
,
$lists
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
display
();
$this
->
display
();
}
}
function
del
()
function
del
()
{
{
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
){
if
(
$id
){
$result
=
M
(
"users_liverecord"
)
->
delete
(
$id
);
$result
=
M
(
"users_liverecord"
)
->
delete
(
$id
);
if
(
$result
){
if
(
$result
){
$this
->
success
(
'删除成功'
);
$this
->
success
(
'删除成功'
);
}
else
{
}
else
{
$this
->
error
(
'删除失败'
);
$this
->
error
(
'删除失败'
);
}
}
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
$this
->
display
();
$this
->
display
();
}
}
}
}
application/Admin/Controller/LivebanController.class.php
View file @
adc15add
...
@@ -12,22 +12,22 @@ class LivebanController extends AdminbaseController {
...
@@ -12,22 +12,22 @@ class LivebanController extends AdminbaseController {
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
}
}
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])));
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
]
.
' 23:59:59'
)));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
$map
[
'liveuid'
]
=
$_REQUEST
[
'keyword'
];
$map
[
'liveuid'
]
=
$_REQUEST
[
'keyword'
];
$_GET
[
'keyword'
]
=
$_REQUEST
[
'keyword'
];
$_GET
[
'keyword'
]
=
$_REQUEST
[
'keyword'
];
}
}
$auth
=
M
(
"live_ban"
);
$auth
=
M
(
"live_ban"
);
$count
=
$auth
->
where
(
$map
)
->
count
();
$count
=
$auth
->
where
(
$map
)
->
count
();
$page
=
$this
->
page
(
$count
,
20
);
$page
=
$this
->
page
(
$count
,
20
);
...
@@ -36,36 +36,36 @@ class LivebanController extends AdminbaseController {
...
@@ -36,36 +36,36 @@ class LivebanController extends AdminbaseController {
->
order
(
"addtime DESC"
)
->
order
(
"addtime DESC"
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
select
();
->
select
();
foreach
(
$lists
as
$k
=>
$v
){
foreach
(
$lists
as
$k
=>
$v
){
$liveinfo
=
getUserInfo
(
$v
[
'liveuid'
]);
$liveinfo
=
getUserInfo
(
$v
[
'liveuid'
]);
$superinfo
=
getUserInfo
(
$v
[
'superid'
]);
$superinfo
=
getUserInfo
(
$v
[
'superid'
]);
$v
[
'liveinfo'
]
=
$liveinfo
;
$v
[
'liveinfo'
]
=
$liveinfo
;
$v
[
'superinfo'
]
=
$superinfo
;
$v
[
'superinfo'
]
=
$superinfo
;
$lists
[
$k
]
=
$v
;
$lists
[
$k
]
=
$v
;
}
}
$this
->
assign
(
'lists'
,
$lists
);
$this
->
assign
(
'lists'
,
$lists
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
display
();
$this
->
display
();
}
}
function
del
(){
function
del
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
){
if
(
$id
){
$result
=
M
(
"live_ban"
)
->
where
(
"liveuid='
{
$id
}
'"
)
->
delete
();
$result
=
M
(
"live_ban"
)
->
where
(
"liveuid='
{
$id
}
'"
)
->
delete
();
if
(
$result
){
if
(
$result
){
$this
->
success
(
'删除成功'
);
$this
->
success
(
'删除成功'
);
}
else
{
}
else
{
$this
->
error
(
'删除失败'
);
$this
->
error
(
'删除失败'
);
}
}
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
}
}
application/Admin/Controller/LivekickController.class.php
View file @
adc15add
...
@@ -12,22 +12,22 @@ class LivekickController extends AdminbaseController {
...
@@ -12,22 +12,22 @@ class LivekickController extends AdminbaseController {
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
}
}
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])));
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
]
.
' 23:59:59'
)));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
$map
[
'uid|liveuid|actionid'
]
=
$_REQUEST
[
'keyword'
];
$map
[
'uid|liveuid|actionid'
]
=
$_REQUEST
[
'keyword'
];
$_GET
[
'keyword'
]
=
$_REQUEST
[
'keyword'
];
$_GET
[
'keyword'
]
=
$_REQUEST
[
'keyword'
];
}
}
$auth
=
M
(
"live_kick"
);
$auth
=
M
(
"live_kick"
);
$count
=
$auth
->
where
(
$map
)
->
count
();
$count
=
$auth
->
where
(
$map
)
->
count
();
$page
=
$this
->
page
(
$count
,
20
);
$page
=
$this
->
page
(
$count
,
20
);
...
@@ -36,7 +36,7 @@ class LivekickController extends AdminbaseController {
...
@@ -36,7 +36,7 @@ class LivekickController extends AdminbaseController {
->
order
(
"addtime DESC"
)
->
order
(
"addtime DESC"
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
select
();
->
select
();
foreach
(
$lists
as
$k
=>
$v
){
foreach
(
$lists
as
$k
=>
$v
){
$uidinfo
=
getUserInfo
(
$v
[
'uid'
]);
$uidinfo
=
getUserInfo
(
$v
[
'uid'
]);
$liveinfo
=
getUserInfo
(
$v
[
'liveuid'
]);
$liveinfo
=
getUserInfo
(
$v
[
'liveuid'
]);
...
@@ -45,29 +45,29 @@ class LivekickController extends AdminbaseController {
...
@@ -45,29 +45,29 @@ class LivekickController extends AdminbaseController {
$v
[
'liveinfo'
]
=
$liveinfo
;
$v
[
'liveinfo'
]
=
$liveinfo
;
$v
[
'actioninfo'
]
=
$actioninfo
;
$v
[
'actioninfo'
]
=
$actioninfo
;
$lists
[
$k
]
=
$v
;
$lists
[
$k
]
=
$v
;
}
}
$this
->
assign
(
'lists'
,
$lists
);
$this
->
assign
(
'lists'
,
$lists
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
display
();
$this
->
display
();
}
}
function
del
(){
function
del
(){
$id
=
intval
(
$_GET
[
'id'
]);
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
){
if
(
$id
){
$result
=
M
(
"live_kick"
)
->
where
(
"id='
{
$id
}
'"
)
->
delete
();
$result
=
M
(
"live_kick"
)
->
where
(
"id='
{
$id
}
'"
)
->
delete
();
if
(
$result
){
if
(
$result
){
$this
->
success
(
'删除成功'
);
$this
->
success
(
'删除成功'
);
}
else
{
}
else
{
$this
->
error
(
'删除失败'
);
$this
->
error
(
'删除失败'
);
}
}
}
else
{
}
else
{
$this
->
error
(
'数据传入失败!'
);
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
}
}
application/Admin/Controller/ManualController.class.php
View file @
adc15add
...
@@ -10,21 +10,21 @@ class ManualController extends AdminbaseController {
...
@@ -10,21 +10,21 @@ class ManualController extends AdminbaseController {
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
}
}
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])));
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
]
.
' 23:59:59'
)));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
$map
[
'touid'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
$map
[
'touid'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
$_GET
[
'keyword'
]
=
$_REQUEST
[
'keyword'
];
$_GET
[
'keyword'
]
=
$_REQUEST
[
'keyword'
];
}
}
$live
=
M
(
"users_charge_admin"
);
$live
=
M
(
"users_charge_admin"
);
$count
=
$live
->
where
(
$map
)
->
count
();
$count
=
$live
->
where
(
$map
)
->
count
();
$page
=
$this
->
page
(
$count
,
20
);
$page
=
$this
->
page
(
$count
,
20
);
...
@@ -38,43 +38,43 @@ class ManualController extends AdminbaseController {
...
@@ -38,43 +38,43 @@ class ManualController extends AdminbaseController {
$userinfo
=
M
(
"users"
)
->
field
(
"user_login,user_nicename"
)
->
where
(
"id='
$v[touid]
'"
)
->
find
();
$userinfo
=
M
(
"users"
)
->
field
(
"user_login,user_nicename"
)
->
where
(
"id='
$v[touid]
'"
)
->
find
();
$lists
[
$k
][
'user_login'
]
=
$userinfo
[
'user_login'
];
$lists
[
$k
][
'user_login'
]
=
$userinfo
[
'user_login'
];
$lists
[
$k
][
'user_nicename'
]
=
$userinfo
[
'user_nicename'
];
$lists
[
$k
][
'user_nicename'
]
=
$userinfo
[
'user_nicename'
];
}
}
$this
->
assign
(
'lists'
,
$lists
);
$this
->
assign
(
'lists'
,
$lists
);
$this
->
assign
(
'coin'
,
$coin
);
$this
->
assign
(
'coin'
,
$coin
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
display
();
$this
->
display
();
}
}
function
add
(){
function
add
(){
$this
->
display
();
$this
->
display
();
}
}
public
function
add_post
()
{
public
function
add_post
()
{
$user_login
=
$_POST
[
'user_login'
];
$user_login
=
$_POST
[
'user_login'
];
$coin
=
$_POST
[
'coin'
];
$coin
=
$_POST
[
'coin'
];
$users_obj
=
M
(
"Users"
);
$users_obj
=
M
(
"Users"
);
if
(
$user_login
==
''
||
$coin
==
''
){
if
(
$user_login
==
''
||
$coin
==
''
){
$this
->
error
(
"信息不全,请填写完整"
);
$this
->
error
(
"信息不全,请填写完整"
);
}
}
$uid
=
$users_obj
->
where
(
"id='
$user_login
'"
)
->
getField
(
"id"
);
$uid
=
$users_obj
->
where
(
"id='
$user_login
'"
)
->
getField
(
"id"
);
if
(
!
$uid
){
if
(
!
$uid
){
$this
->
error
(
"会员不存在,请更正"
);
$this
->
error
(
"会员不存在,请更正"
);
}
}
$id
=
$_SESSION
[
'ADMIN_ID'
];
$id
=
$_SESSION
[
'ADMIN_ID'
];
$user
=
$users_obj
->
where
(
"id=
$id
"
)
->
find
();
$user
=
$users_obj
->
where
(
"id=
$id
"
)
->
find
();
$result
=
M
(
"users_charge_admin"
)
->
add
(
array
(
"touid"
=>
$uid
,
"coin"
=>
$coin
,
"addtime"
=>
time
(),
"admin"
=>
$user
[
'user_login'
],
"ip"
=>
$_SERVER
[
'REMOTE_ADDR'
]));
$result
=
M
(
"users_charge_admin"
)
->
add
(
array
(
"touid"
=>
$uid
,
"coin"
=>
$coin
,
"addtime"
=>
time
(),
"admin"
=>
$user
[
'user_login'
],
"ip"
=>
$_SERVER
[
'REMOTE_ADDR'
]));
if
(
$result
)
{
if
(
$result
)
{
M
(
"users"
)
->
where
(
"id='
$user_login
'"
)
->
setInc
(
"coin"
,
$coin
);
M
(
"users"
)
->
where
(
"id='
$user_login
'"
)
->
setInc
(
"coin"
,
$coin
);
$this
->
success
(
"充值成功!"
);
$this
->
success
(
"充值成功!"
);
}
else
{
}
else
{
$this
->
error
(
"充值失败!"
);
$this
->
error
(
"充值失败!"
);
...
@@ -84,16 +84,16 @@ class ManualController extends AdminbaseController {
...
@@ -84,16 +84,16 @@ class ManualController extends AdminbaseController {
{
{
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
}
}
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])));
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])));
}
}
if
(
$_REQUEST
[
'keyword'
]
!=
''
)
if
(
$_REQUEST
[
'keyword'
]
!=
''
)
{
{
$map
[
'touid'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
$map
[
'touid'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
}
}
$xlsName
=
"Excel"
;
$xlsName
=
"Excel"
;
$live
=
M
(
"users_charge_admin"
);
$live
=
M
(
"users_charge_admin"
);
...
@@ -102,7 +102,7 @@ class ManualController extends AdminbaseController {
...
@@ -102,7 +102,7 @@ class ManualController extends AdminbaseController {
{
{
$userinfo
=
M
(
"users"
)
->
field
(
"user_login,user_nicename"
)
->
where
(
"id='
$v[touid]
'"
)
->
find
();
$userinfo
=
M
(
"users"
)
->
field
(
"user_login,user_nicename"
)
->
where
(
"id='
$v[touid]
'"
)
->
find
();
$xlsData
[
$k
][
'user_nicename'
]
=
$userinfo
[
'user_nicename'
]
.
"("
.
$userinfo
[
'user_login'
]
.
")"
.
"("
.
$v
[
'touid'
]
.
")"
;
$xlsData
[
$k
][
'user_nicename'
]
=
$userinfo
[
'user_nicename'
]
.
"("
.
$userinfo
[
'user_login'
]
.
")"
.
"("
.
$v
[
'touid'
]
.
")"
;
$xlsData
[
$k
][
'addtime'
]
=
date
(
"Y-m-d H:i:s"
,
$v
[
'addtime'
]);
$xlsData
[
$k
][
'addtime'
]
=
date
(
"Y-m-d H:i:s"
,
$v
[
'addtime'
]);
}
}
$action
=
"导出手动充值记录:"
.
M
(
"users_charge_admin"
)
->
getLastSql
();
$action
=
"导出手动充值记录:"
.
M
(
"users_charge_admin"
)
->
getLastSql
();
setAdminLog
(
$action
);
setAdminLog
(
$action
);
...
@@ -117,6 +117,6 @@ class ManualController extends AdminbaseController {
...
@@ -117,6 +117,6 @@ class ManualController extends AdminbaseController {
);
);
exportExcel
(
$xlsName
,
$xlsCell
,
$xlsData
,
$cellName
);
exportExcel
(
$xlsName
,
$xlsCell
,
$xlsData
,
$cellName
);
}
}
}
}
application/Admin/Controller/SettlechargeController.class.php
View file @
adc15add
...
@@ -37,7 +37,7 @@ class SettlechargeController extends AdminbaseController{
...
@@ -37,7 +37,7 @@ class SettlechargeController extends AdminbaseController{
$where
[
'r.role_id'
]
=
'6'
;
$where
[
'r.role_id'
]
=
'6'
;
}
}
$Charge
=
M
(
'users_charge'
);
$Charge
=
M
(
'users_charge'
);
$Chargerecord
=
M
(
'settlement_charge_record'
);
$Chargerecord
=
M
(
'settlement_charge_record'
);
...
@@ -50,7 +50,7 @@ class SettlechargeController extends AdminbaseController{
...
@@ -50,7 +50,7 @@ class SettlechargeController extends AdminbaseController{
->
order
(
"u.create_time DESC"
)
->
order
(
"u.create_time DESC"
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
select
();
->
select
();
foreach
(
$lists
as
$k
=>
$v
){
foreach
(
$lists
as
$k
=>
$v
){
$v
[
'isshow'
]
=
'1'
;
$v
[
'isshow'
]
=
'1'
;
if
(
$admin_roleid
==
7
){
if
(
$admin_roleid
==
7
){
...
@@ -73,17 +73,17 @@ class SettlechargeController extends AdminbaseController{
...
@@ -73,17 +73,17 @@ class SettlechargeController extends AdminbaseController{
$total_charge
=
'0'
;
$total_charge
=
'0'
;
}
}
$v
[
'total_charge'
]
=
$total_charge
;
$v
[
'total_charge'
]
=
$total_charge
;
$total_chargeed
=
$Chargerecord
->
where
(
"uid=
{
$v
[
'id'
]
}
"
)
->
sum
(
'money'
);
$total_chargeed
=
$Chargerecord
->
where
(
"uid=
{
$v
[
'id'
]
}
"
)
->
sum
(
'money'
);
if
(
!
$total_chargeed
){
if
(
!
$total_chargeed
){
$total_chargeed
=
'0'
;
$total_chargeed
=
'0'
;
}
}
$v
[
'total_chargeed'
]
=
$total_chargeed
;
$v
[
'total_chargeed'
]
=
$total_chargeed
;
$total_charge_no
=
$total_charge
-
$total_chargeed
;
$total_charge_no
=
$total_charge
-
$total_chargeed
;
$v
[
'total_charge_no'
]
=
$total_charge_no
;
$v
[
'total_charge_no'
]
=
$total_charge_no
;
$lasttime
=
'未结算'
;
$lasttime
=
'未结算'
;
$lastrecord
=
$Chargerecord
->
where
(
"uid=
{
$v
[
'id'
]
}
"
)
->
order
(
'id desc'
)
->
find
();
$lastrecord
=
$Chargerecord
->
where
(
"uid=
{
$v
[
'id'
]
}
"
)
->
order
(
'id desc'
)
->
find
();
if
(
$lastrecord
){
if
(
$lastrecord
){
...
@@ -91,11 +91,11 @@ class SettlechargeController extends AdminbaseController{
...
@@ -91,11 +91,11 @@ class SettlechargeController extends AdminbaseController{
}
}
$v
[
'lasttime'
]
=
$lasttime
;
$v
[
'lasttime'
]
=
$lasttime
;
$lists
[
$k
]
=
$v
;
$lists
[
$k
]
=
$v
;
}
}
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"lists"
,
$lists
);
$this
->
assign
(
"lists"
,
$lists
);
...
@@ -103,28 +103,28 @@ class SettlechargeController extends AdminbaseController{
...
@@ -103,28 +103,28 @@ class SettlechargeController extends AdminbaseController{
$this
->
assign
(
"adminid"
,
$adminid
);
$this
->
assign
(
"adminid"
,
$adminid
);
$this
->
display
();
$this
->
display
();
}
}
/* 结算列表 */
/* 结算列表 */
function
index2
(){
function
index2
(){
$uid
=
(
int
)
I
(
'id'
);
$uid
=
(
int
)
I
(
'id'
);
$userinfo
=
M
(
'users'
)
->
field
(
'user_login,user_nicename'
)
->
where
(
"id=
{
$uid
}
"
)
->
find
();
$userinfo
=
M
(
'users'
)
->
field
(
'user_login,user_nicename'
)
->
where
(
"id=
{
$uid
}
"
)
->
find
();
if
(
$userinfo
[
'user_nicename'
]
==
''
){
if
(
$userinfo
[
'user_nicename'
]
==
''
){
$userinfo
[
'user_nicename'
]
=
$userinfo
[
'user_login'
];
$userinfo
[
'user_nicename'
]
=
$userinfo
[
'user_login'
];
}
}
$role_id
=
M
(
'role_user'
)
->
where
(
"user_id=
{
$uid
}
"
)
->
getfield
(
'role_id'
);
$role_id
=
M
(
'role_user'
)
->
where
(
"user_id=
{
$uid
}
"
)
->
getfield
(
'role_id'
);
if
(
$role_id
==
6
){
if
(
$role_id
==
6
){
$userinfo
[
'role'
]
=
'代理商'
;
$userinfo
[
'role'
]
=
'代理商'
;
}
else
if
(
$role_id
==
7
){
}
else
if
(
$role_id
==
7
){
$userinfo
[
'role'
]
=
'业务员'
;
$userinfo
[
'role'
]
=
'业务员'
;
}
}
$this
->
assign
(
'userinfo'
,
$userinfo
);
$this
->
assign
(
'userinfo'
,
$userinfo
);
$adminid
=
$_SESSION
[
'ADMIN_ID'
];
$adminid
=
$_SESSION
[
'ADMIN_ID'
];
$admin_roleid
=
$_SESSION
[
'role_id'
];
$admin_roleid
=
$_SESSION
[
'role_id'
];
$Proxy
=
M
(
'users_proxy'
);
$Proxy
=
M
(
'users_proxy'
);
$Charge
=
M
(
'users_charge'
);
$Charge
=
M
(
'users_charge'
);
$Chargesettle
=
M
(
'settlement_charge'
);
$Chargesettle
=
M
(
'settlement_charge'
);
...
@@ -139,7 +139,7 @@ class SettlechargeController extends AdminbaseController{
...
@@ -139,7 +139,7 @@ class SettlechargeController extends AdminbaseController{
$map
=
[];
$map
=
[];
$map
[
'uid'
]
=
array
(
'in'
,
$uids
);
$map
[
'uid'
]
=
array
(
'in'
,
$uids
);
/* 生成结算列表 --start */
/* 生成结算列表 --start */
$nowtime
=
time
();
$nowtime
=
time
();
//当天0点
//当天0点
...
@@ -152,7 +152,7 @@ class SettlechargeController extends AdminbaseController{
...
@@ -152,7 +152,7 @@ class SettlechargeController extends AdminbaseController{
$ifexist
=
$Chargesettle
->
where
(
"uid=
{
$uid
}
"
)
->
order
(
"id desc"
)
->
find
();
$ifexist
=
$Chargesettle
->
where
(
"uid=
{
$uid
}
"
)
->
order
(
"id desc"
)
->
find
();
if
(
$ifexist
){
if
(
$ifexist
){
$starttime
=
$ifexist
[
'date'
]
+
60
*
60
*
24
;
$starttime
=
$ifexist
[
'date'
]
+
60
*
60
*
24
;
}
else
{
}
else
{
$first
=
$Charge
->
where
(
"status=1"
)
->
where
(
$map
)
->
order
(
"id asc"
)
->
find
();
$first
=
$Charge
->
where
(
"status=1"
)
->
where
(
$map
)
->
order
(
"id asc"
)
->
find
();
if
(
$first
){
if
(
$first
){
...
@@ -164,7 +164,7 @@ class SettlechargeController extends AdminbaseController{
...
@@ -164,7 +164,7 @@ class SettlechargeController extends AdminbaseController{
$data_add
=
[];
$data_add
=
[];
for
(
$i
=
$starttime
;
$i
<
$today_start
;){
for
(
$i
=
$starttime
;
$i
<
$today_start
;){
$end
=
$i
+
60
*
60
*
24
;
$end
=
$i
+
60
*
60
*
24
;
$total_charge
=
$Charge
->
where
(
"status=1 and addtime>=
{
$i
}
and addtime <
{
$end
}
"
)
->
where
(
$map
)
->
sum
(
'money'
);
$total_charge
=
$Charge
->
where
(
"status=1 and addtime>=
{
$i
}
and addtime <
{
$end
}
"
)
->
where
(
$map
)
->
sum
(
'money'
);
if
(
$total_charge
){
if
(
$total_charge
){
$data_add_item
=
[
$data_add_item
=
[
...
@@ -174,27 +174,27 @@ class SettlechargeController extends AdminbaseController{
...
@@ -174,27 +174,27 @@ class SettlechargeController extends AdminbaseController{
];
];
$data_add
[]
=
$data_add_item
;
$data_add
[]
=
$data_add_item
;
}
}
$i
=
$end
;
$i
=
$end
;
}
}
if
(
$data_add
){
if
(
$data_add
){
$Chargesettle
->
addAll
(
$data_add
);
$Chargesettle
->
addAll
(
$data_add
);
}
}
}
}
/* 生成结算列表 --end */
/* 生成结算列表 --end */
$where
=
[];
$where
=
[];
$where3
=
[];
$where3
=
[];
$where
[
'uid'
]
=
$uid
;
$where
[
'uid'
]
=
$uid
;
$_GET
[
'id'
]
=
$uid
;
$_GET
[
'id'
]
=
$uid
;
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
$where
[
'date'
]
=
array
(
"egt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$where
[
'date'
]
=
array
(
"egt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$where3
[
'addtime'
]
=
array
(
"egt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$where3
[
'addtime'
]
=
array
(
"egt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
}
}
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
$where
[
'date'
]
=
array
(
"elt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$where
[
'date'
]
=
array
(
"elt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$where3
[
'addtime'
]
=
array
(
"elt"
,
strtotime
(
$_REQUEST
[
'end_time'
])
+
60
*
60
*
24
-
1
);
$where3
[
'addtime'
]
=
array
(
"elt"
,
strtotime
(
$_REQUEST
[
'end_time'
])
+
60
*
60
*
24
-
1
);
...
@@ -206,25 +206,25 @@ class SettlechargeController extends AdminbaseController{
...
@@ -206,25 +206,25 @@ class SettlechargeController extends AdminbaseController{
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
$data
=
[];
$data
=
[];
$total_charge
=
$Charge
->
where
(
"status=1"
)
->
where
(
$map
)
->
where
(
$where3
)
->
sum
(
'money'
);
$total_charge
=
$Charge
->
where
(
"status=1"
)
->
where
(
$map
)
->
where
(
$where3
)
->
sum
(
'money'
);
if
(
!
$total_charge
){
if
(
!
$total_charge
){
$total_charge
=
'0'
;
$total_charge
=
'0'
;
}
}
$data
[
'total_charge'
]
=
$total_charge
;
$data
[
'total_charge'
]
=
$total_charge
;
$total_chargeed
=
$Chargesettle
->
where
(
" status='1'"
)
->
where
(
$where
)
->
sum
(
'money'
);
$total_chargeed
=
$Chargesettle
->
where
(
" status='1'"
)
->
where
(
$where
)
->
sum
(
'money'
);
if
(
!
$total_chargeed
){
if
(
!
$total_chargeed
){
$total_chargeed
=
'0'
;
$total_chargeed
=
'0'
;
}
}
$data
[
'total_chargeed'
]
=
$total_chargeed
;
$data
[
'total_chargeed'
]
=
$total_chargeed
;
$total_charge_no
=
$total_charge
-
$total_chargeed
;
$total_charge_no
=
$total_charge
-
$total_chargeed
;
$data
[
'total_charge_no'
]
=
$total_charge_no
;
$data
[
'total_charge_no'
]
=
$total_charge_no
;
$count
=
$Chargesettle
->
where
(
$where
)
->
count
();
$count
=
$Chargesettle
->
where
(
$where
)
->
count
();
$page
=
$this
->
page
(
$count
,
20
);
$page
=
$this
->
page
(
$count
,
20
);
...
@@ -233,62 +233,62 @@ class SettlechargeController extends AdminbaseController{
...
@@ -233,62 +233,62 @@ class SettlechargeController extends AdminbaseController{
->
order
(
"id DESC"
)
->
order
(
"id DESC"
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
select
();
->
select
();
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"data"
,
$data
);
$this
->
assign
(
"data"
,
$data
);
$this
->
assign
(
"lists"
,
$lists
);
$this
->
assign
(
"lists"
,
$lists
);
$this
->
assign
(
"status"
,
$this
->
status
);
$this
->
assign
(
"status"
,
$this
->
status
);
$this
->
display
();
$this
->
display
();
}
}
/* 结算 */
/* 结算 */
function
setSettle
(){
function
setSettle
(){
$uid
=
(
int
)
I
(
'id'
);
$uid
=
(
int
)
I
(
'id'
);
$where
=
[];
$where
=
[];
$where3
=
[];
$where3
=
[];
$where
[
'uid'
]
=
$uid
;
$where
[
'uid'
]
=
$uid
;
$nowtime
=
time
();
$nowtime
=
time
();
//当天0点
//当天0点
$today
=
date
(
"Ymd"
,
$nowtime
);
$today
=
date
(
"Ymd"
,
$nowtime
);
$today_start
=
strtotime
(
$today
);
$today_start
=
strtotime
(
$today
);
$time_slot
=
'全部'
;
$time_slot
=
'全部'
;
$_GET
[
'id'
]
=
$uid
;
$_GET
[
'id'
]
=
$uid
;
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
$where
[
'date'
]
=
array
(
"egt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$where
[
'date'
]
=
array
(
"egt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$time_slot
=
$_REQUEST
[
'start_time'
]
.
'之后'
;
$time_slot
=
$_REQUEST
[
'start_time'
]
.
'之后'
;
}
}
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
$where
[
'date'
]
=
array
(
"elt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$where
[
'date'
]
=
array
(
"elt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$time_slot
=
$_REQUEST
[
'end_time'
]
.
'之前'
;
$time_slot
=
$_REQUEST
[
'end_time'
]
.
'之前'
;
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
$where
[
'date'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])));
$where
[
'date'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
]
.
' 23:59:59'
)));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$time_slot
=
$_REQUEST
[
'start_time'
]
.
'--'
.
$_REQUEST
[
'end_time'
];
$time_slot
=
$_REQUEST
[
'start_time'
]
.
'--'
.
$_REQUEST
[
'end_time'
];
}
}
$Chargesettle
=
M
(
'settlement_charge'
);
$Chargesettle
=
M
(
'settlement_charge'
);
$Chargerecord
=
M
(
'settlement_charge_record'
);
$Chargerecord
=
M
(
'settlement_charge_record'
);
$total
=
$Chargesettle
->
where
(
"status=0"
)
->
where
(
$where
)
->
sum
(
'money'
);
$total
=
$Chargesettle
->
where
(
"status=0"
)
->
where
(
$where
)
->
sum
(
'money'
);
if
(
!
$total
){
if
(
!
$total
){
$this
->
error
(
'当前时间段内无有效结算'
,
U
(
'Settlecharge/index2'
,
array
(
'id'
=>
$uid
,
'start_time'
=>
$_GET
[
'start_time'
],
'end_time'
=>
$_GET
[
'end_time'
])));
$this
->
error
(
'当前时间段内无有效结算'
,
U
(
'Settlecharge/index2'
,
array
(
'id'
=>
$uid
,
'start_time'
=>
$_GET
[
'start_time'
],
'end_time'
=>
$_GET
[
'end_time'
])));
}
}
$Chargesettle
->
where
(
"status=0"
)
->
where
(
$where
)
->
save
([
'status'
=>
1
,
'uptime'
=>
time
()]);
$Chargesettle
->
where
(
"status=0"
)
->
where
(
$where
)
->
save
([
'status'
=>
1
,
'uptime'
=>
time
()]);
$record
=
[
$record
=
[
'uid'
=>
$uid
,
'uid'
=>
$uid
,
...
@@ -298,31 +298,31 @@ class SettlechargeController extends AdminbaseController{
...
@@ -298,31 +298,31 @@ class SettlechargeController extends AdminbaseController{
'time_slot'
=>
$time_slot
,
'time_slot'
=>
$time_slot
,
];
];
$Chargerecord
->
add
(
$record
);
$Chargerecord
->
add
(
$record
);
$this
->
success
(
'结算成功'
,
U
(
'Settlecharge/index2'
,
array
(
'id'
=>
$uid
,
'start_time'
=>
$_GET
[
'start_time'
],
'end_time'
=>
$_GET
[
'end_time'
])));
$this
->
success
(
'结算成功'
,
U
(
'Settlecharge/index2'
,
array
(
'id'
=>
$uid
,
'start_time'
=>
$_GET
[
'start_time'
],
'end_time'
=>
$_GET
[
'end_time'
])));
}
}
/* 结算记录 */
/* 结算记录 */
function
record
(){
function
record
(){
$uid
=
(
int
)
I
(
'id'
);
$uid
=
(
int
)
I
(
'id'
);
$where
=
[];
$where
=
[];
$where
[
'uid'
]
=
$uid
;
$where
[
'uid'
]
=
$uid
;
$Chargerecord
=
M
(
'settlement_charge_record'
);
$Chargerecord
=
M
(
'settlement_charge_record'
);
$userinfo
=
M
(
'users'
)
->
field
(
'user_login,user_nicename'
)
->
where
(
"id=
{
$uid
}
"
)
->
find
();
$userinfo
=
M
(
'users'
)
->
field
(
'user_login,user_nicename'
)
->
where
(
"id=
{
$uid
}
"
)
->
find
();
if
(
$userinfo
[
'user_nicename'
]
==
''
){
if
(
$userinfo
[
'user_nicename'
]
==
''
){
$userinfo
[
'user_nicename'
]
=
$userinfo
[
'user_login'
];
$userinfo
[
'user_nicename'
]
=
$userinfo
[
'user_login'
];
}
}
$role_id
=
M
(
'role_user'
)
->
where
(
"user_id=
{
$uid
}
"
)
->
getfield
(
'role_id'
);
$role_id
=
M
(
'role_user'
)
->
where
(
"user_id=
{
$uid
}
"
)
->
getfield
(
'role_id'
);
if
(
$role_id
==
6
){
if
(
$role_id
==
6
){
$userinfo
[
'role'
]
=
'代理商'
;
$userinfo
[
'role'
]
=
'代理商'
;
}
else
if
(
$role_id
==
7
){
}
else
if
(
$role_id
==
7
){
$userinfo
[
'role'
]
=
'业务员'
;
$userinfo
[
'role'
]
=
'业务员'
;
}
}
$count
=
$Chargerecord
->
where
(
$where
)
->
count
();
$count
=
$Chargerecord
->
where
(
$where
)
->
count
();
$page
=
$this
->
page
(
$count
,
20
);
$page
=
$this
->
page
(
$count
,
20
);
$lists
=
$Chargerecord
$lists
=
$Chargerecord
...
@@ -331,13 +331,13 @@ class SettlechargeController extends AdminbaseController{
...
@@ -331,13 +331,13 @@ class SettlechargeController extends AdminbaseController{
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
select
();
->
select
();
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"lists"
,
$lists
);
$this
->
assign
(
"lists"
,
$lists
);
$this
->
assign
(
"userinfo"
,
$userinfo
);
$this
->
assign
(
"userinfo"
,
$userinfo
);
$this
->
display
();
$this
->
display
();
}
}
}
}
\ No newline at end of file
application/Admin/Controller/SettlevotesController.class.php
View file @
adc15add
...
@@ -49,7 +49,7 @@ class SettlevotesController extends AdminbaseController{
...
@@ -49,7 +49,7 @@ class SettlevotesController extends AdminbaseController{
->
order
(
"u.create_time DESC"
)
->
order
(
"u.create_time DESC"
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
select
();
->
select
();
foreach
(
$lists
as
$k
=>
$v
){
foreach
(
$lists
as
$k
=>
$v
){
$v
[
'isshow'
]
=
'1'
;
$v
[
'isshow'
]
=
'1'
;
if
(
$admin_roleid
==
7
){
if
(
$admin_roleid
==
7
){
...
@@ -72,17 +72,17 @@ class SettlevotesController extends AdminbaseController{
...
@@ -72,17 +72,17 @@ class SettlevotesController extends AdminbaseController{
$total_votes
=
'0'
;
$total_votes
=
'0'
;
}
}
$v
[
'total_votes'
]
=
$total_votes
;
$v
[
'total_votes'
]
=
$total_votes
;
$total_votesed
=
$Votesrecord
->
where
(
"uid=
{
$v
[
'id'
]
}
"
)
->
sum
(
'votes'
);
$total_votesed
=
$Votesrecord
->
where
(
"uid=
{
$v
[
'id'
]
}
"
)
->
sum
(
'votes'
);
if
(
!
$total_votesed
){
if
(
!
$total_votesed
){
$total_votesed
=
'0'
;
$total_votesed
=
'0'
;
}
}
$v
[
'total_votesed'
]
=
$total_votesed
;
$v
[
'total_votesed'
]
=
$total_votesed
;
$total_votes_no
=
$total_votes
-
$total_votesed
;
$total_votes_no
=
$total_votes
-
$total_votesed
;
$v
[
'total_votes_no'
]
=
$total_votes_no
;
$v
[
'total_votes_no'
]
=
$total_votes_no
;
$lasttime
=
'未结算'
;
$lasttime
=
'未结算'
;
$lastrecord
=
$Votesrecord
->
where
(
"uid=
{
$v
[
'id'
]
}
"
)
->
order
(
'id desc'
)
->
find
();
$lastrecord
=
$Votesrecord
->
where
(
"uid=
{
$v
[
'id'
]
}
"
)
->
order
(
'id desc'
)
->
find
();
if
(
$lastrecord
){
if
(
$lastrecord
){
...
@@ -90,11 +90,11 @@ class SettlevotesController extends AdminbaseController{
...
@@ -90,11 +90,11 @@ class SettlevotesController extends AdminbaseController{
}
}
$v
[
'lasttime'
]
=
$lasttime
;
$v
[
'lasttime'
]
=
$lasttime
;
$lists
[
$k
]
=
$v
;
$lists
[
$k
]
=
$v
;
}
}
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"lists"
,
$lists
);
$this
->
assign
(
"lists"
,
$lists
);
...
@@ -102,28 +102,28 @@ class SettlevotesController extends AdminbaseController{
...
@@ -102,28 +102,28 @@ class SettlevotesController extends AdminbaseController{
$this
->
assign
(
"adminid"
,
$adminid
);
$this
->
assign
(
"adminid"
,
$adminid
);
$this
->
display
();
$this
->
display
();
}
}
/* 结算列表 */
/* 结算列表 */
function
index2
(){
function
index2
(){
$uid
=
(
int
)
I
(
'id'
);
$uid
=
(
int
)
I
(
'id'
);
$userinfo
=
M
(
'users'
)
->
field
(
'user_login,user_nicename'
)
->
where
(
"id=
{
$uid
}
"
)
->
find
();
$userinfo
=
M
(
'users'
)
->
field
(
'user_login,user_nicename'
)
->
where
(
"id=
{
$uid
}
"
)
->
find
();
if
(
$userinfo
[
'user_nicename'
]
==
''
){
if
(
$userinfo
[
'user_nicename'
]
==
''
){
$userinfo
[
'user_nicename'
]
=
$userinfo
[
'user_login'
];
$userinfo
[
'user_nicename'
]
=
$userinfo
[
'user_login'
];
}
}
$role_id
=
M
(
'role_user'
)
->
where
(
"user_id=
{
$uid
}
"
)
->
getfield
(
'role_id'
);
$role_id
=
M
(
'role_user'
)
->
where
(
"user_id=
{
$uid
}
"
)
->
getfield
(
'role_id'
);
if
(
$role_id
==
6
){
if
(
$role_id
==
6
){
$userinfo
[
'role'
]
=
'代理商'
;
$userinfo
[
'role'
]
=
'代理商'
;
}
else
if
(
$role_id
==
7
){
}
else
if
(
$role_id
==
7
){
$userinfo
[
'role'
]
=
'业务员'
;
$userinfo
[
'role'
]
=
'业务员'
;
}
}
$this
->
assign
(
'userinfo'
,
$userinfo
);
$this
->
assign
(
'userinfo'
,
$userinfo
);
$adminid
=
$_SESSION
[
'ADMIN_ID'
];
$adminid
=
$_SESSION
[
'ADMIN_ID'
];
$admin_roleid
=
$_SESSION
[
'role_id'
];
$admin_roleid
=
$_SESSION
[
'role_id'
];
$Proxy
=
M
(
'users_proxy'
);
$Proxy
=
M
(
'users_proxy'
);
$Votes
=
M
(
'users_voterecord'
);
$Votes
=
M
(
'users_voterecord'
);
$Votessettle
=
M
(
'settlement_votes'
);
$Votessettle
=
M
(
'settlement_votes'
);
...
@@ -138,7 +138,7 @@ class SettlevotesController extends AdminbaseController{
...
@@ -138,7 +138,7 @@ class SettlevotesController extends AdminbaseController{
$map
=
[];
$map
=
[];
$map
[
'uid'
]
=
array
(
'in'
,
$uids
);
$map
[
'uid'
]
=
array
(
'in'
,
$uids
);
/* 生成结算列表 --start */
/* 生成结算列表 --start */
$nowtime
=
time
();
$nowtime
=
time
();
//当天0点
//当天0点
...
@@ -151,7 +151,7 @@ class SettlevotesController extends AdminbaseController{
...
@@ -151,7 +151,7 @@ class SettlevotesController extends AdminbaseController{
$ifexist
=
$Votessettle
->
where
(
"uid=
{
$uid
}
"
)
->
order
(
"id desc"
)
->
find
();
$ifexist
=
$Votessettle
->
where
(
"uid=
{
$uid
}
"
)
->
order
(
"id desc"
)
->
find
();
if
(
$ifexist
){
if
(
$ifexist
){
$starttime
=
$ifexist
[
'date'
]
+
60
*
60
*
24
;
$starttime
=
$ifexist
[
'date'
]
+
60
*
60
*
24
;
}
else
{
}
else
{
$first
=
$Votes
->
where
(
"type='income'"
)
->
where
(
$map
)
->
order
(
"id asc"
)
->
find
();
$first
=
$Votes
->
where
(
"type='income'"
)
->
where
(
$map
)
->
order
(
"id asc"
)
->
find
();
if
(
$first
){
if
(
$first
){
...
@@ -163,7 +163,7 @@ class SettlevotesController extends AdminbaseController{
...
@@ -163,7 +163,7 @@ class SettlevotesController extends AdminbaseController{
$data_add
=
[];
$data_add
=
[];
for
(
$i
=
$starttime
;
$i
<
$today_start
;){
for
(
$i
=
$starttime
;
$i
<
$today_start
;){
$end
=
$i
+
60
*
60
*
24
;
$end
=
$i
+
60
*
60
*
24
;
$total_votes
=
$Votes
->
where
(
"type='income' and addtime>=
{
$i
}
and addtime <
{
$end
}
"
)
->
where
(
$map
)
->
sum
(
'votes'
);
$total_votes
=
$Votes
->
where
(
"type='income' and addtime>=
{
$i
}
and addtime <
{
$end
}
"
)
->
where
(
$map
)
->
sum
(
'votes'
);
if
(
$total_votes
){
if
(
$total_votes
){
$data_add_item
=
[
$data_add_item
=
[
...
@@ -173,57 +173,57 @@ class SettlevotesController extends AdminbaseController{
...
@@ -173,57 +173,57 @@ class SettlevotesController extends AdminbaseController{
];
];
$data_add
[]
=
$data_add_item
;
$data_add
[]
=
$data_add_item
;
}
}
$i
=
$end
;
$i
=
$end
;
}
}
if
(
$data_add
){
if
(
$data_add
){
$Votessettle
->
addAll
(
$data_add
);
$Votessettle
->
addAll
(
$data_add
);
}
}
}
}
/* 生成结算列表 --end */
/* 生成结算列表 --end */
$where
=
[];
$where
=
[];
$where3
=
[];
$where3
=
[];
$where
[
'uid'
]
=
$uid
;
$where
[
'uid'
]
=
$uid
;
$_GET
[
'id'
]
=
$uid
;
$_GET
[
'id'
]
=
$uid
;
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
$where
[
'date'
]
=
array
(
"egt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$where
[
'date'
]
=
array
(
"egt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$where3
[
'addtime'
]
=
array
(
"egt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$where3
[
'addtime'
]
=
array
(
"egt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
}
}
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
$where
[
'date'
]
=
array
(
"elt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$where
[
'date'
]
=
array
(
"elt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$where3
[
'addtime'
]
=
array
(
"elt"
,
strtotime
(
$_REQUEST
[
'end_time'
])
+
60
*
60
*
24
-
1
);
$where3
[
'addtime'
]
=
array
(
"elt"
,
strtotime
(
$_REQUEST
[
'end_time'
])
+
60
*
60
*
24
-
1
);
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
$where
[
'date'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])));
$where
[
'date'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
]
.
' 23:59:59'
)));
$where3
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])
+
60
*
60
*
24
-
1
));
$where3
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])
+
60
*
60
*
24
-
1
));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
$data
=
[];
$data
=
[];
$total_votes
=
$Votes
->
where
(
"type='income'"
)
->
where
(
$map
)
->
where
(
$where3
)
->
sum
(
'votes'
);
$total_votes
=
$Votes
->
where
(
"type='income'"
)
->
where
(
$map
)
->
where
(
$where3
)
->
sum
(
'votes'
);
if
(
!
$total_votes
){
if
(
!
$total_votes
){
$total_votes
=
'0'
;
$total_votes
=
'0'
;
}
}
$data
[
'total_votes'
]
=
$total_votes
;
$data
[
'total_votes'
]
=
$total_votes
;
$total_votesed
=
$Votessettle
->
where
(
" status='1'"
)
->
where
(
$where
)
->
sum
(
'votes'
);
$total_votesed
=
$Votessettle
->
where
(
" status='1'"
)
->
where
(
$where
)
->
sum
(
'votes'
);
if
(
!
$total_votesed
){
if
(
!
$total_votesed
){
$total_votesed
=
'0'
;
$total_votesed
=
'0'
;
}
}
$data
[
'total_votesed'
]
=
$total_votesed
;
$data
[
'total_votesed'
]
=
$total_votesed
;
$total_votes_no
=
$total_votes
-
$total_votesed
;
$total_votes_no
=
$total_votes
-
$total_votesed
;
$data
[
'total_votes_no'
]
=
$total_votes_no
;
$data
[
'total_votes_no'
]
=
$total_votes_no
;
$count
=
$Votessettle
->
where
(
$where
)
->
count
();
$count
=
$Votessettle
->
where
(
$where
)
->
count
();
$page
=
$this
->
page
(
$count
,
20
);
$page
=
$this
->
page
(
$count
,
20
);
...
@@ -232,40 +232,40 @@ class SettlevotesController extends AdminbaseController{
...
@@ -232,40 +232,40 @@ class SettlevotesController extends AdminbaseController{
->
order
(
"id DESC"
)
->
order
(
"id DESC"
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
select
();
->
select
();
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"data"
,
$data
);
$this
->
assign
(
"data"
,
$data
);
$this
->
assign
(
"lists"
,
$lists
);
$this
->
assign
(
"lists"
,
$lists
);
$this
->
assign
(
"status"
,
$this
->
status
);
$this
->
assign
(
"status"
,
$this
->
status
);
$this
->
display
();
$this
->
display
();
}
}
/* 结算 */
/* 结算 */
function
setSettle
(){
function
setSettle
(){
$uid
=
(
int
)
I
(
'id'
);
$uid
=
(
int
)
I
(
'id'
);
$where
=
[];
$where
=
[];
$where3
=
[];
$where3
=
[];
$where
[
'uid'
]
=
$uid
;
$where
[
'uid'
]
=
$uid
;
$nowtime
=
time
();
$nowtime
=
time
();
//当天0点
//当天0点
$today
=
date
(
"Ymd"
,
$nowtime
);
$today
=
date
(
"Ymd"
,
$nowtime
);
$today_start
=
strtotime
(
$today
);
$today_start
=
strtotime
(
$today
);
$time_slot
=
'全部'
;
$time_slot
=
'全部'
;
$_GET
[
'id'
]
=
$uid
;
$_GET
[
'id'
]
=
$uid
;
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
$where
[
'date'
]
=
array
(
"egt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$where
[
'date'
]
=
array
(
"egt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$time_slot
=
$_REQUEST
[
'start_time'
]
.
'之后'
;
$time_slot
=
$_REQUEST
[
'start_time'
]
.
'之后'
;
}
}
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
$where
[
'date'
]
=
array
(
"elt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$where
[
'date'
]
=
array
(
"elt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
...
@@ -275,19 +275,19 @@ class SettlevotesController extends AdminbaseController{
...
@@ -275,19 +275,19 @@ class SettlevotesController extends AdminbaseController{
$where
[
'date'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])));
$where
[
'date'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$time_slot
=
$_REQUEST
[
'start_time'
]
.
'--'
.
$_REQUEST
[
'end_time'
];
$time_slot
=
$_REQUEST
[
'start_time'
]
.
'--'
.
$_REQUEST
[
'end_time'
];
}
}
$Votessettle
=
M
(
'settlement_votes'
);
$Votessettle
=
M
(
'settlement_votes'
);
$Votesrecord
=
M
(
'settlement_votes_record'
);
$Votesrecord
=
M
(
'settlement_votes_record'
);
$total
=
$Votessettle
->
where
(
"status=0"
)
->
where
(
$where
)
->
sum
(
'votes'
);
$total
=
$Votessettle
->
where
(
"status=0"
)
->
where
(
$where
)
->
sum
(
'votes'
);
if
(
!
$total
){
if
(
!
$total
){
$this
->
error
(
'当前时间段内无有效结算'
,
U
(
'Settlevotes/index2'
,
array
(
'id'
=>
$uid
,
'start_time'
=>
$_GET
[
'start_time'
],
'end_time'
=>
$_GET
[
'end_time'
])));
$this
->
error
(
'当前时间段内无有效结算'
,
U
(
'Settlevotes/index2'
,
array
(
'id'
=>
$uid
,
'start_time'
=>
$_GET
[
'start_time'
],
'end_time'
=>
$_GET
[
'end_time'
])));
}
}
$Votessettle
->
where
(
"status=0"
)
->
where
(
$where
)
->
save
([
'status'
=>
1
,
'uptime'
=>
time
()]);
$Votessettle
->
where
(
"status=0"
)
->
where
(
$where
)
->
save
([
'status'
=>
1
,
'uptime'
=>
time
()]);
$record
=
[
$record
=
[
'uid'
=>
$uid
,
'uid'
=>
$uid
,
...
@@ -297,31 +297,31 @@ class SettlevotesController extends AdminbaseController{
...
@@ -297,31 +297,31 @@ class SettlevotesController extends AdminbaseController{
'time_slot'
=>
$time_slot
,
'time_slot'
=>
$time_slot
,
];
];
$Votesrecord
->
add
(
$record
);
$Votesrecord
->
add
(
$record
);
$this
->
success
(
'结算成功'
,
U
(
'Settlevotes/index2'
,
array
(
'id'
=>
$uid
,
'start_time'
=>
$_GET
[
'start_time'
],
'end_time'
=>
$_GET
[
'end_time'
])));
$this
->
success
(
'结算成功'
,
U
(
'Settlevotes/index2'
,
array
(
'id'
=>
$uid
,
'start_time'
=>
$_GET
[
'start_time'
],
'end_time'
=>
$_GET
[
'end_time'
])));
}
}
/* 结算记录 */
/* 结算记录 */
function
record
(){
function
record
(){
$uid
=
(
int
)
I
(
'id'
);
$uid
=
(
int
)
I
(
'id'
);
$where
=
[];
$where
=
[];
$where
[
'uid'
]
=
$uid
;
$where
[
'uid'
]
=
$uid
;
$Votesrecord
=
M
(
'settlement_votes_record'
);
$Votesrecord
=
M
(
'settlement_votes_record'
);
$userinfo
=
M
(
'users'
)
->
field
(
'user_login,user_nicename'
)
->
where
(
"id=
{
$uid
}
"
)
->
find
();
$userinfo
=
M
(
'users'
)
->
field
(
'user_login,user_nicename'
)
->
where
(
"id=
{
$uid
}
"
)
->
find
();
if
(
$userinfo
[
'user_nicename'
]
==
''
){
if
(
$userinfo
[
'user_nicename'
]
==
''
){
$userinfo
[
'user_nicename'
]
=
$userinfo
[
'user_login'
];
$userinfo
[
'user_nicename'
]
=
$userinfo
[
'user_login'
];
}
}
$role_id
=
M
(
'role_user'
)
->
where
(
"user_id=
{
$uid
}
"
)
->
getfield
(
'role_id'
);
$role_id
=
M
(
'role_user'
)
->
where
(
"user_id=
{
$uid
}
"
)
->
getfield
(
'role_id'
);
if
(
$role_id
==
6
){
if
(
$role_id
==
6
){
$userinfo
[
'role'
]
=
'代理商'
;
$userinfo
[
'role'
]
=
'代理商'
;
}
else
if
(
$role_id
==
7
){
}
else
if
(
$role_id
==
7
){
$userinfo
[
'role'
]
=
'业务员'
;
$userinfo
[
'role'
]
=
'业务员'
;
}
}
$count
=
$Votesrecord
->
where
(
$where
)
->
count
();
$count
=
$Votesrecord
->
where
(
$where
)
->
count
();
$page
=
$this
->
page
(
$count
,
20
);
$page
=
$this
->
page
(
$count
,
20
);
$lists
=
$Votesrecord
$lists
=
$Votesrecord
...
@@ -330,13 +330,13 @@ class SettlevotesController extends AdminbaseController{
...
@@ -330,13 +330,13 @@ class SettlevotesController extends AdminbaseController{
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
limit
(
$page
->
firstRow
.
','
.
$page
->
listRows
)
->
select
();
->
select
();
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
assign
(
"lists"
,
$lists
);
$this
->
assign
(
"lists"
,
$lists
);
$this
->
assign
(
"userinfo"
,
$userinfo
);
$this
->
assign
(
"userinfo"
,
$userinfo
);
$this
->
display
();
$this
->
display
();
}
}
}
}
\ No newline at end of file
application/Admin/Controller/UserauthController.class.php
View file @
adc15add
...
@@ -29,7 +29,7 @@ class UserauthController extends AdminbaseController
...
@@ -29,7 +29,7 @@ class UserauthController extends AdminbaseController
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
)
{
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
)
{
$map
[
'addtime'
]
=
[
"between"
,
[
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])]];
$map
[
'addtime'
]
=
[
"between"
,
[
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
]
.
' 23:59:59'
)]];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
...
@@ -69,7 +69,7 @@ class UserauthController extends AdminbaseController
...
@@ -69,7 +69,7 @@ class UserauthController extends AdminbaseController
$map
[
'addtime'
]
=
[
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
])];
$map
[
'addtime'
]
=
[
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
])];
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
)
{
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
)
{
$map
[
'addtime'
]
=
[
"between"
,
[
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])]];
$map
[
'addtime'
]
=
[
"between"
,
[
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
]
.
' 23:59:59'
)]];
}
}
if
(
$_REQUEST
[
'keyword'
]
!=
''
)
{
if
(
$_REQUEST
[
'keyword'
]
!=
''
)
{
...
@@ -212,7 +212,7 @@ class UserauthController extends AdminbaseController
...
@@ -212,7 +212,7 @@ class UserauthController extends AdminbaseController
}
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
)
{
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
)
{
$map
[
'addtime'
]
=
[
"between"
,
[
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])]];
$map
[
'addtime'
]
=
[
"between"
,
[
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
]
.
' 23:59:59'
)]];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
}
...
...
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