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
0d4102dd
Commit
0d4102dd
authored
Jun 12, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
65888024
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
UserLog.php
application/index/controller/UserLog.php
+10
-3
UserLogValidate.php
application/index/validate/UserLogValidate.php
+8
-3
No files found.
application/index/controller/UserLog.php
View file @
0d4102dd
...
...
@@ -74,12 +74,19 @@ class UserLog extends Basic{
"type" => 1,
);*/
if
(
!
isset
(
$params
[
'user_id'
])
||
!
isset
(
$params
[
'type'
]))
{
return
$this
->
response
(
"101"
,
"参数不全"
);
$checkResult
=
$this
->
validate
(
$params
,
"UserLogValidate.userLog"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
101
,
$checkResult
);
}
$user_id
=
$params
[
'user_id'
];
$type
=
$params
[
'type'
];
$result
=
$this
->
service_
->
userLog
(
$user_id
,
$this
->
siteId
,
$type
);
if
(
$params
[
'entrust_type'
]
==
1
){
$result
=
$this
->
OfficeUserLogService
->
userLog
(
$user_id
,
$this
->
siteId
,
$type
);
}
else
{
$result
=
$this
->
service_
->
userLog
(
$user_id
,
$this
->
siteId
,
$type
);
}
if
(
count
(
$result
)
>
0
){
return
$this
->
response
(
"200"
,
"success!"
,
$result
);
...
...
application/index/validate/UserLogValidate.php
View file @
0d4102dd
...
...
@@ -13,8 +13,9 @@ use think\Validate;
class
UserLogValidate
extends
Validate
{
protected
$rule
=
[
'user_id'
=>
'require|number|gt:0'
,
'entrust_type'
=>
'require|number'
,
'user_id'
=>
'require|number|gt:0'
,
'entrust_type'
=>
'require|number'
,
'type'
=>
'require|number'
,
];
protected
$message
=
[
...
...
@@ -23,9 +24,12 @@ class UserLogValidate extends Validate
'user_id.gt'
=>
'user_id必须大于0'
,
'entrust_type.require'
=>
'entrust_type为必填字段'
,
'entrust_type.number'
=>
'entrust_type只能为数字'
,
'type.require'
=>
'entrust_type为必填字段'
,
'type.number'
=>
'entrust_type只能为数字'
,
];
protected
$scene
=
[
'followUpLog'
=>
[
'agent_id'
,
'entrust_type'
],
'followUpLog'
=>
[
'user_id'
,
'entrust_type'
],
'userLog'
=>
[
'user_id'
,
'entrust_type'
,
'type'
],
];
}
\ 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