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
fa9890b8
Commit
fa9890b8
authored
Jun 27, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
记录客户拨打经纪手机号时间间隔
parent
c50506b7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
14 deletions
+27
-14
Broker.php
application/api/controller/Broker.php
+12
-5
VerifyRepetitionService.php
application/api_broker/service/VerifyRepetitionService.php
+15
-9
No files found.
application/api/controller/Broker.php
View file @
fa9890b8
...
...
@@ -3,6 +3,7 @@
namespace
app\api\controller
;
use
app\api\extend\Basic
;
use
app\api_broker\service\VerifyRepetitionService
;
use
app\model\AAgents
;
use
app\model\Evaluate
;
use
app\model\EvaluateSign
;
...
...
@@ -251,12 +252,18 @@ class Broker extends Basic
$data
[
'msg'
]
=
''
;
if
(
$this
->
params
[
'agent_id'
]
>
0
)
{
$m_agents
=
new
AAgents
();
$agents_data
=
$m_agents
->
getAgentInfo
(
'id,update_time,call_number'
,
$this
->
params
[
'agent_id'
]);
$insert_data
[
'update_time'
]
=
$agents_data
[
'update_time'
];
$insert_data
[
'call_number'
]
=
$agents_data
[
'call_number'
]
+
1
;
$data
[
'data'
]
=
$m_agents
->
editData
(
$insert_data
,
$agents_data
[
'id'
]);
$redis
=
new
VerifyRepetitionService
();
$is
=
$redis
->
verifyStart
(
2
,
$this
->
params
[
'agent_id'
],
$this
->
userId
);
if
(
$is
)
{
$m_agents
=
new
AAgents
();
$agents_data
=
$m_agents
->
getAgentInfo
(
'id,update_time,call_number'
,
$this
->
params
[
'agent_id'
]);
$insert_data
[
'update_time'
]
=
$agents_data
[
'update_time'
];
$insert_data
[
'call_number'
]
=
$agents_data
[
'call_number'
]
+
1
;
$data
[
'data'
]
=
$m_agents
->
editData
(
$insert_data
,
$agents_data
[
'id'
]);
}
}
else
{
$data
[
'status'
]
=
101
;
...
...
application/api_broker/service/VerifyRepetitionService.php
View file @
fa9890b8
<?php
namespace
app\api_broker\service
;
use
app\extra\RedisExt
;
/**
...
...
@@ -9,38 +11,42 @@ use app\extra\RedisExt;
* Time : 10:28
* Intro:
*/
class
VerifyRepetitionService
{
class
VerifyRepetitionService
{
private
$redis_
;
const
MARCH_IN_KEY
=
"_march_in_"
;
const
TIME_OUT
=
60
;
// 超时时间1分钟
const
CALL_NUMBER
=
"_call_number_"
;
const
TIME_OUT
=
120
;
// 超时时间1分钟
public
function
__construct
()
{
$this
->
redis_
=
RedisExt
::
getRedis
();
}
public
function
verifyStart
(
int
$type
,
int
$agent_id
,
int
$order_id
)
:
bool
{
public
function
verifyStart
(
int
$type
,
int
$agent_id
,
int
$order_id
)
:
bool
{
if
(
!
$this
->
redis_
)
{
if
(
!
$this
->
redis_
)
{
return
true
;
}
$key
=
""
;
switch
(
$type
){
switch
(
$type
)
{
case
1
:
//进场
$key
=
self
::
MARCH_IN_KEY
;
break
;
case
2
:
$key
=
self
::
CALL_NUMBER
;
break
;
case
3
:
break
;
default
:
}
if
(
$this
->
redis_
->
get
(
$agent_id
.
$key
.
$order_id
)){
if
(
$this
->
redis_
->
get
(
$agent_id
.
$key
.
$order_id
))
{
return
false
;
}
else
{
$this
->
redis_
->
set
(
$agent_id
.
$key
.
$order_id
,
1
,
self
::
TIME_OUT
);
}
else
{
$this
->
redis_
->
set
(
$agent_id
.
$key
.
$order_id
,
1
,
self
::
TIME_OUT
);
return
true
;
}
...
...
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