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
7e9e75f8
Commit
7e9e75f8
authored
Aug 28, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
记录经纪人看客户
parent
c5f807b8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
0 deletions
+79
-0
UserLogService.php
application/index/service/UserLogService.php
+34
-0
TLookAgentUserModel.php
application/model/TLookAgentUserModel.php
+45
-0
No files found.
application/index/service/UserLogService.php
View file @
7e9e75f8
...
@@ -14,6 +14,7 @@ use app\model\ACollectUser;
...
@@ -14,6 +14,7 @@ use app\model\ACollectUser;
use
app\model\ASite
;
use
app\model\ASite
;
use
app\model\GOperatingRecords
;
use
app\model\GOperatingRecords
;
use
app\model\OReportModel
;
use
app\model\OReportModel
;
use
app\model\TLookAgentUserModel
;
use
app\model\ULabels
;
use
app\model\ULabels
;
use
app\model\UPhoneFollowUp
;
use
app\model\UPhoneFollowUp
;
use
app\model\UPhoneFollowUpTemporary
;
use
app\model\UPhoneFollowUpTemporary
;
...
@@ -125,6 +126,7 @@ class UserLogService
...
@@ -125,6 +126,7 @@ class UserLogService
$user_agent_res
=
$s_user_agent
->
selectUserAgent
(
$user_id
);
$user_agent_res
=
$s_user_agent
->
selectUserAgent
(
$user_id
);
$data
[
'customer_relegation_list'
]
=
$user_agent_res
?
$user_agent_res
:
[];
$data
[
'customer_relegation_list'
]
=
$user_agent_res
?
$user_agent_res
:
[];
$this
->
agentLookUser
(
$user_id
,
$agent_id
,
1
);
//记录经纪人看客户
return
[
"code"
=>
200
,
"data"
=>
$data
];
return
[
"code"
=>
200
,
"data"
=>
$data
];
}
}
...
@@ -273,6 +275,7 @@ class UserLogService
...
@@ -273,6 +275,7 @@ class UserLogService
#编辑客户详情权限 0:有权限 1:无权限
#编辑客户详情权限 0:有权限 1:无权限
$result
[
'is_can_edit_user_info'
]
=
$user_service
->
isCanEditUserInfo
(
$result
[
"agent_id"
],
$agent_id
,
$user_id
);
$result
[
'is_can_edit_user_info'
]
=
$user_service
->
isCanEditUserInfo
(
$result
[
"agent_id"
],
$agent_id
,
$user_id
);
$this
->
agentLookUser
(
$user_id
,
$agent_id
,
0
);
//记录经纪人看客户
return
$result
;
return
$result
;
}
}
...
@@ -540,5 +543,35 @@ class UserLogService
...
@@ -540,5 +543,35 @@ class UserLogService
return
$return
;
return
$return
;
}
}
/**
* 记录经纪人查看客户
*
* @param $user_id
* @param $agent_id
* @param $source
* @return bool
*/
public
function
agentLookUser
(
$user_id
,
$agent_id
,
$source
)
{
if
(
empty
(
$user_id
))
{
return
false
;
}
if
(
empty
(
$agent_id
))
{
return
false
;
}
$m_look_user
=
new
TLookAgentUserModel
();
$redis_ext
=
RedisExt
::
getRedis
();
$key
=
't_look_agent_user_'
.
$agent_id
.
'_'
.
$user_id
;
$num
=
$redis_ext
->
get
(
$key
);
if
(
empty
(
$num
))
{
$id
=
$m_look_user
->
insertData
(
$user_id
,
$agent_id
,
$source
);
$today_time
=
strtotime
(
date
(
'Y-m-d'
)
.
' 23:59:59'
)
-
time
();
//到0点剩余时间
$redis_ext
->
set
(
$key
,
$id
,
$today_time
);
}
return
true
;
}
}
}
\ No newline at end of file
application/model/TLookAgentUserModel.php
0 → 100644
View file @
7e9e75f8
<?php
/**
* Created by PhpStorm.
* User: 43897
* Date: 2019/8/28
* Time: 13:32
*/
namespace
app\model
;
use
think\Db
;
class
TLookAgentUserModel
extends
BaseModel
{
protected
$table
=
"t_look_agent_user"
;
private
$db_
;
function
__construct
(
$data
=
[])
{
parent
::
__construct
(
$data
);
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
/**
* @param $user_id
* @param $agent_id
* @param int $source 0app 1后台
* @return int|string
*/
public
function
insertData
(
$user_id
,
$agent_id
,
$source
=
0
)
{
if
(
!
empty
(
$user_id
)
&&
!
empty
(
$agent_id
))
{
$save_data
[
'user_id'
]
=
$user_id
;
$save_data
[
'agent_id'
]
=
$agent_id
;
$save_data
[
'source'
]
=
$source
;
$save_data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
);
$id
=
$this
->
db_
->
insertGetId
(
$save_data
);
}
else
{
$id
=
0
;
}
return
$id
;
}
}
\ 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