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
7f43582d
Commit
7f43582d
authored
Aug 30, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
38bf647d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
30 deletions
+10
-30
Bargain.php
application/api_broker/controller/Bargain.php
+0
-13
Basic.php
application/api_broker/extend/Basic.php
+1
-2
ClientService.php
application/api_broker/service/ClientService.php
+9
-13
route.php
application/route.php
+0
-2
No files found.
application/api_broker/controller/Bargain.php
View file @
7f43582d
...
...
@@ -4,8 +4,6 @@ namespace app\api_broker\controller;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\BargainService
;
use
app\extra\RedisExt
;
use
app\model\AliYunSecretReport
;
use
think\Request
;
/**
...
...
@@ -52,14 +50,4 @@ class Bargain extends Basic
return
$this
->
response
(
"200"
,
"success"
,
$result
);
}
public
function
test
()
{
$model
=
new
AliYunSecretReport
();
$redis
=
RedisExt
::
getRedis
();
$userList
=
$model
->
getCallUserId
();
foreach
(
$userList
as
$item
)
{
$redis
->
set
(
"save_call_num_"
.
$item
[
"users_id"
],
1
,
3600
*
24
);
}
}
}
\ No newline at end of file
application/api_broker/extend/Basic.php
View file @
7f43582d
...
...
@@ -55,8 +55,7 @@ class Basic extends Controller
'broker/editDecFeedClick'
,
'broker/sendSms'
,
'broker/getNewsInfo'
,
'broker/getComment'
,
'broker/bargainTest'
,
'broker/getComment'
);
/**
...
...
application/api_broker/service/ClientService.php
View file @
7f43582d
...
...
@@ -18,6 +18,7 @@ class ClientService
private
$redis
;
private
$day
;
private
$num
;
private
$nowTime
;
const
SAVE_CALL_NUM
=
"save_call_num_"
;
public
function
__construct
()
...
...
@@ -25,34 +26,29 @@ class ClientService
$this
->
uPhoneFollowUpModel
=
new
UPhoneFollowPp
();
$this
->
redis
=
RedisExt
::
getRedis
();
$this
->
day
=
$this
->
redis
->
get
(
"s_agent_call_day"
);
$this
->
num
=
$this
->
redis
->
get
(
"s_agent_call_number"
);
$this
->
day
=
$this
->
redis
->
get
(
"s_agent_call_day"
);
$this
->
num
=
$this
->
redis
->
get
(
"s_agent_call_number"
);
$this
->
nowTime
=
date
(
"Y-m-d"
,
time
());
}
public
function
dialTotal
(
$user_id
)
{
/* $start_time = date("Y-m-d H:i:s", strtotime("-$day day"));
$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);*/
$call_num
=
empty
(
$this
->
redis
->
get
(
self
::
SAVE_CALL_NUM
.
$user_id
))
?
0
:
$this
->
redis
->
get
(
self
::
SAVE_CALL_NUM
.
$user_id
);
$call_num
=
empty
(
$this
->
redis
->
get
(
self
::
SAVE_CALL_NUM
.
$this
->
nowTime
.
$user_id
))
?
0
:
$this
->
redis
->
get
(
self
::
SAVE_CALL_NUM
.
$this
->
nowTime
.
$user_id
);
if
(
$call_num
>=
$this
->
num
)
{
return
false
;
}
else
{
return
true
;
}
}
public
function
saveCallNumByUserId
(
$user_id
)
{
$call_num
=
$this
->
redis
->
get
(
self
::
SAVE_CALL_NUM
.
$user_id
);
$call_num
=
$this
->
redis
->
get
(
self
::
SAVE_CALL_NUM
.
$
this
->
nowTime
.
$
user_id
);
if
(
$call_num
)
{
$this
->
redis
->
incr
(
self
::
SAVE_CALL_NUM
.
$user_id
);
$this
->
redis
->
incr
(
self
::
SAVE_CALL_NUM
.
$
this
->
nowTime
.
$
user_id
);
}
else
{
$this
->
redis
->
set
(
self
::
SAVE_CALL_NUM
.
$user_id
,
1
,
$this
->
day
*
3600
*
24
);
$this
->
redis
->
set
(
self
::
SAVE_CALL_NUM
.
$
this
->
nowTime
.
$
user_id
,
1
,
$this
->
day
*
3600
*
24
);
}
}
...
...
application/route.php
View file @
7f43582d
...
...
@@ -585,8 +585,6 @@ Route::group('broker', [
'bargainMain'
=>
[
'api_broker/Bargain/bargainList'
,
[
'method'
=>
'POST|GET'
]
],
'bargainTest'
=>
[
'api_broker/Bargain/test'
,
[
'method'
=>
'POST|GET'
]
],
]);
...
...
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