Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
e2037690
Commit
e2037690
authored
Jan 30, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
操作记录
parent
c3a2c537
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
1 deletion
+43
-1
Login.php
application/index/controller/Login.php
+1
-1
Basic.php
application/index/extend/Basic.php
+42
-0
No files found.
application/index/controller/Login.php
View file @
e2037690
...
...
@@ -52,7 +52,7 @@ class Login extends Basic
Session
::
set
(
"userName"
,
$result
[
0
][
"name"
]);
Session
::
set
(
"userId"
,
$result
[
0
][
"id"
]);
Session
::
set
(
"lastLoginTime"
,
time
());
$this
->
operating_records
(
$result
[
0
][
"id"
],
1
,
'后台登陆'
);
//记录操作日志
$this
->
redirect
(
'/admin.php/index/banner'
);
}
else
{
return
view
(
"/login/login"
,
[
"msg"
=>
"用户名或密码错误"
]);
...
...
application/index/extend/Basic.php
View file @
e2037690
...
...
@@ -13,6 +13,7 @@ use think\Controller;
use
think\Request
;
use
think\Response
;
use
think\Session
;
use
think\Db
;
class
Basic
extends
Controller
{
...
...
@@ -218,6 +219,47 @@ class Basic extends Controller
}
}
/**
* 记录操作
*
* @param int $agents_id
* @param array $data
* @param string $type
* @param string $remark
* @return bool
*/
/**
* 记录操作
*
* @param int $agents_id
* @param string $type
* @param string $remark
* @return bool|int|string
*/
public
function
operating_records
(
$agents_id
=
0
,
$type
=
''
,
$remark
=
''
)
{
$result
=
false
;
$agents_id
=
Session
::
get
(
'userId'
)
?
Session
::
get
(
'userId'
)
:
$agents_id
;
if
(
$agents_id
>
0
)
{
$name
=
Session
::
get
(
'userName'
);
if
(
$name
)
{
$name
=
Db
::
table
(
'a_agents'
)
->
where
(
'id'
,
$agents_id
)
->
value
(
'name'
);
}
$data
=
[
'agents_id'
=>
$agents_id
,
'name'
=>
$name
,
'url'
=>
$this
->
request
->
url
(),
'ip'
=>
$this
->
request
->
ip
(),
'remark'
=>
$remark
,
'type'
=>
$type
,
'create_time'
=>
date
(
'Y-m-d H:i:s'
)
];
$result
=
Db
::
table
(
'g_operating_records'
)
->
insert
(
$data
);
}
return
$result
;
}
}
...
...
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