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
1e76303b
Commit
1e76303b
authored
Aug 23, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
7b44afb0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
16 deletions
+26
-16
ClientService.php
application/api_broker/service/ClientService.php
+25
-15
BargainValidate.php
application/api_broker/validate/BargainValidate.php
+1
-1
No files found.
application/api_broker/service/ClientService.php
View file @
1e76303b
...
@@ -16,35 +16,44 @@ class ClientService
...
@@ -16,35 +16,44 @@ class ClientService
{
{
private
$uPhoneFollowUpModel
;
private
$uPhoneFollowUpModel
;
private
$redis
;
private
$redis
;
private
$day
;
private
$num
;
const
SAVE_CALL_NUM
=
"save_call_num_"
;
public
function
__construct
()
public
function
__construct
()
{
{
$this
->
uPhoneFollowUpModel
=
new
UPhoneFollowPp
();
$this
->
uPhoneFollowUpModel
=
new
UPhoneFollowPp
();
$this
->
redis
=
RedisExt
::
getRedis
();
$this
->
redis
=
RedisExt
::
getRedis
();
$this
->
day
=
$this
->
redis
->
get
(
"s_agent_call_day"
);
$this
->
num
=
$this
->
redis
->
get
(
"s_agent_call_number"
);
}
}
public
function
dialTotal
(
$user_id
)
public
function
dialTotal
(
$user_id
)
{
{
$day
=
1
;
/* $start_time = date("Y-m-d H:i:s", strtotime("-$day day"));
$num
=
5
;
$end_time = date("Y-m-d H:i:s", time());
if
(
$this
->
redis
)
{
$params["create_time"] = array( "between", array( $start_time, $end_time ) );
$day
=
$this
->
redis
->
get
(
"s_agent_call_day"
);
$params["user_id"] = $user_id;
$num
=
$this
->
redis
->
get
(
"s_agent_call_number"
);
}
$total = $this->uPhoneFollowUpModel->getCount($params);*/
$call_num
=
empty
(
$this
->
redis
->
get
(
self
::
SAVE_CALL_NUM
.
$user_id
))
?
0
:
$this
->
redis
->
get
(
self
::
SAVE_CALL_NUM
.
$user_id
);
$start_time
=
date
(
"Y-m-d H:i:s"
,
strtotime
(
"-
$day
day"
));
if
(
$call_num
>=
$this
->
num
)
{
$end_time
=
date
(
"Y-m-d H:i:s"
,
time
());
$params
[
"create_time"
]
=
array
(
"between"
,
array
(
$start_time
,
$end_time
)
);
$params
[
"user_id"
]
=
$user_id
;
$total
=
$this
->
uPhoneFollowUpModel
->
getCount
(
$params
);
if
(
$total
>=
$num
)
{
return
false
;
return
false
;
}
else
{
}
else
{
return
true
;
return
true
;
}
}
}
public
function
saveCallNumByUserId
(
$user_id
)
{
$call_num
=
$this
->
redis
->
get
(
self
::
SAVE_CALL_NUM
.
$user_id
);
if
(
$call_num
>
0
)
{
$this
->
redis
->
set
(
self
::
SAVE_CALL_NUM
.
$user_id
,
$call_num
+
1
);
}
else
{
$this
->
redis
->
set
(
self
::
SAVE_CALL_NUM
.
$user_id
,
1
,
$this
->
day
*
3600
);
}
}
}
}
}
\ No newline at end of file
application/api_broker/validate/BargainValidate.php
View file @
1e76303b
...
@@ -15,7 +15,7 @@ class BargainValidate extends Validate
...
@@ -15,7 +15,7 @@ class BargainValidate extends Validate
{
{
protected
$rule
=
[
protected
$rule
=
[
'submit_agent_id'
=>
'require|number'
,
'submit_agent_id'
=>
'require|number'
,
'status'
=>
'require|number|in:0,1,2,3'
,
'status'
=>
'require|number|in:0,1,2,3
,4
'
,
'is_my_correlation'
=>
'require|number|in:0,1'
,
'is_my_correlation'
=>
'require|number|in:0,1'
,
];
];
...
...
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