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
353ef496
Commit
353ef496
authored
Dec 29, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
搜索控制
parent
9909f2a4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
2 deletions
+50
-2
HomePageLog.php
application/api_broker/controller/HomePageLog.php
+6
-1
VerifyRepetitionService.php
application/api_broker/service/VerifyRepetitionService.php
+38
-0
Remark.php
application/index/controller/Remark.php
+6
-1
No files found.
application/api_broker/controller/HomePageLog.php
View file @
353ef496
...
@@ -57,7 +57,12 @@ class HomePageLog extends Basic
...
@@ -57,7 +57,12 @@ class HomePageLog extends Basic
$vrs
=
new
VerifyRepetitionService
();
$vrs
=
new
VerifyRepetitionService
();
$is_check
=
$vrs
->
followUpClick
(
$this
->
agentId
);
$is_check
=
$vrs
->
followUpClick
(
$this
->
agentId
);
if
(
$params
[
"pageNo"
]
==
1
&&
!
$is_check
){
if
(
$params
[
"pageNo"
]
==
1
&&
!
$is_check
){
return
$this
->
response
(
"101"
,
"请勿频繁请求"
);
$is_bool
=
$vrs
->
getCurrTimeSection
();
$msg
=
"请勿频繁请求"
;
if
(
$is_bool
)
{
$msg
=
"高峰期间每10秒钟只能搜索一次(6.30-8.30)"
;
}
return
$this
->
response
(
"101"
,
$msg
);
}
}
...
...
application/api_broker/service/VerifyRepetitionService.php
View file @
353ef496
...
@@ -64,6 +64,27 @@ class VerifyRepetitionService
...
@@ -64,6 +64,27 @@ class VerifyRepetitionService
if
(
!
$this
->
redis_
)
{
if
(
!
$this
->
redis_
)
{
return
true
;
return
true
;
}
}
/*$time = 20;
$record_click = $this->redis_->get("record_click_" .$agent_id);
if (!$record_click ) {
$this->redis_->set("record_click_" .$agent_id, 1, $time);
} elseif( $record_click < 3) {
$this->redis_->incr("record_click_" .$agent_id);
}else{
//兼容出现永久请勿频繁请求问题
//$this->redis_->set("record_click_" .$agent_id, 3, 5);
return false;
}*/
$is_bool
=
$this
->
getCurrTimeSection
();
if
(
$is_bool
){
$time
=
10
;
$record_click
=
$this
->
redis_
->
get
(
"record_click_"
.
$agent_id
);
if
(
!
$record_click
)
{
$this
->
redis_
->
set
(
"record_click_"
.
$agent_id
,
1
,
$time
);
}
else
{
return
false
;
}
}
else
{
$time
=
20
;
$time
=
20
;
$record_click
=
$this
->
redis_
->
get
(
"record_click_"
.
$agent_id
);
$record_click
=
$this
->
redis_
->
get
(
"record_click_"
.
$agent_id
);
if
(
!
$record_click
)
{
if
(
!
$record_click
)
{
...
@@ -75,7 +96,23 @@ class VerifyRepetitionService
...
@@ -75,7 +96,23 @@ class VerifyRepetitionService
//$this->redis_->set("record_click_" .$agent_id, 3, 5);
//$this->redis_->set("record_click_" .$agent_id, 3, 5);
return
false
;
return
false
;
}
}
}
return
true
;
}
public
function
getCurrTimeSection
()
{
$checkDayStr
=
date
(
'Y-m-d '
,
time
());
$timeBegin1
=
strtotime
(
$checkDayStr
.
"18:30"
.
":00"
);
$timeEnd1
=
strtotime
(
$checkDayStr
.
"20:30"
.
":00"
);
$curr_time
=
time
();
if
(
$curr_time
>=
$timeBegin1
&&
$curr_time
<=
$timeEnd1
)
{
return
true
;
return
true
;
}
}
return
false
;
}
}
}
\ No newline at end of file
application/index/controller/Remark.php
View file @
353ef496
...
@@ -41,7 +41,12 @@ class Remark extends Basic
...
@@ -41,7 +41,12 @@ class Remark extends Basic
$vrs
=
new
VerifyRepetitionService
();
$vrs
=
new
VerifyRepetitionService
();
$is_check
=
$vrs
->
followUpClick
(
$this
->
userId
);
$is_check
=
$vrs
->
followUpClick
(
$this
->
userId
);
if
(
$this
->
params
[
'pageNo'
]
==
1
&&
!
$is_check
){
if
(
$this
->
params
[
'pageNo'
]
==
1
&&
!
$is_check
){
return
$this
->
response
(
"101"
,
"请勿频繁请求"
);
$is_bool
=
$vrs
->
getCurrTimeSection
();
$msg
=
"请勿频繁请求"
;
if
(
$is_bool
)
{
$msg
=
"高峰期间每10秒钟只能搜索一次(6.30-8.30)"
;
}
return
$this
->
response
(
"101"
,
$msg
);
}
}
$u_phone_follow
=
new
UPhoneFollowPp
(
$this
->
siteId
);
$u_phone_follow
=
new
UPhoneFollowPp
(
$this
->
siteId
);
...
...
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