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
eee5407e
Commit
eee5407e
authored
Apr 23, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
7477780d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
25 deletions
+27
-25
application/Admin/Controller/AdminlogController.class.php
+27
-25
No files found.
application/Admin/Controller/AdminlogController.class.php
View file @
eee5407e
...
...
@@ -8,17 +8,17 @@ use Common\Controller\AdminbaseController;
class
AdminlogController
extends
AdminbaseController
{
function
index
(){
if
(
$_REQUEST
[
'start_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"gt"
,
strtotime
(
$_REQUEST
[
'start_time'
]));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
}
if
(
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"lt"
,
strtotime
(
$_REQUEST
[
'end_time'
]));
$_GET
[
'end_time'
]
=
$_REQUEST
[
'end_time'
];
}
if
(
$_REQUEST
[
'start_time'
]
!=
''
&&
$_REQUEST
[
'end_time'
]
!=
''
){
$map
[
'addtime'
]
=
array
(
"between"
,
array
(
strtotime
(
$_REQUEST
[
'start_time'
]),
strtotime
(
$_REQUEST
[
'end_time'
])));
$_GET
[
'start_time'
]
=
$_REQUEST
[
'start_time'
];
...
...
@@ -26,10 +26,10 @@ class AdminlogController extends AdminbaseController {
}
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
$map
[
'adminid'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
$map
[
'adminid'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
$_GET
[
'keyword'
]
=
$_REQUEST
[
'keyword'
];
}
}
$AdminLog
=
M
(
"admin_log"
);
$count
=
$AdminLog
->
where
(
$map
)
->
count
();
$page
=
$this
->
page
(
$count
,
20
);
...
...
@@ -42,55 +42,57 @@ class AdminlogController extends AdminbaseController {
$this
->
assign
(
'lists'
,
$lists
);
$this
->
assign
(
'formget'
,
$_GET
);
$this
->
assign
(
"page"
,
$page
->
show
(
'Admin'
));
$this
->
display
();
}
function
del
(){
$id
=
intval
(
$_GET
[
'id'
]);
if
(
$id
){
$result
=
M
(
"admin_log"
)
->
delete
(
$id
);
$result
=
M
(
"admin_log"
)
->
delete
(
$id
);
if
(
$result
){
$this
->
success
(
'删除成功'
);
}
else
{
$this
->
error
(
'删除失败'
);
}
}
else
{
}
}
else
{
$this
->
error
(
'数据传入失败!'
);
}
}
}
}
function
export
()
{
if
(
$_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'
]));
}
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'
])));
}
if
(
$_REQUEST
[
'keyword'
]
!=
''
){
$map
[
'adminid'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
$map
[
'adminid'
]
=
array
(
"like"
,
"%"
.
$_REQUEST
[
'keyword'
]
.
"%"
);
}
$xlsName
=
"Excel"
;
$AdminLog
=
M
(
"admin_log"
);
$xlsData
=
$AdminLog
->
where
(
$map
)
->
order
(
"addtime DESC"
)
->
select
();
foreach
(
$xlsData
as
$k
=>
$v
)
{
$xlsData
[
$k
][
'msg_type'
]
=
$this
->
msg_type
[
$v
[
'type'
]];
$xlsData
[
$k
][
'addtime'
]
=
date
(
"Y-m-d H:i:s"
,
$v
[
'addtime'
]);
// $xlsData[$k]['msg_type']=$this->msg_type[$v['type']];
$xlsData
[
$k
][
'addtime'
]
=
date
(
"Y-m-d H:i:s"
,
$v
[
'addtime'
]);
$xlsData
[
$k
][
'ip'
]
=
long2ip
(
$v
[
'ip'
]);
}
$cellName
=
array
(
'A'
,
'B'
,
'C'
,
'D'
,
'E'
);
$xlsCell
=
array
(
array
(
'id'
,
'序号'
),
array
(
'msg_type'
,
'信息类型'
),
array
(
'account'
,
'接收账号'
),
array
(
'content'
,
'信息内容'
),
array
(
'addtime'
,
'提交时间'
),
array
(
'adminid'
,
'管理员ID'
),
array
(
'admin'
,
'管理员'
),
array
(
'action'
,
'操作'
),
array
(
'ip'
,
'IP'
),
array
(
'addtime'
,
'时间'
),
);
exportExcel
(
$xlsName
,
$xlsCell
,
$xlsData
,
$cellName
);
}
}
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