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
8d842de7
Commit
8d842de7
authored
Apr 09, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
缓存清理
parent
68107c57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
0 deletions
+70
-0
route.php
application/route.php
+3
-0
UpdateRedisCache.php
application/task/controller/UpdateRedisCache.php
+67
-0
No files found.
application/route.php
View file @
8d842de7
...
@@ -627,6 +627,9 @@ Route::group('task', [
...
@@ -627,6 +627,9 @@ Route::group('task', [
'killOutTimeSql'
=>
[
'task/KillOutTimeSql/killOutTimeSql'
,
[
'method'
=>
'get'
]],
//超过有效期的券改过期
'killOutTimeSql'
=>
[
'task/KillOutTimeSql/killOutTimeSql'
,
[
'method'
=>
'get'
]],
//超过有效期的券改过期
'delHouseVideo'
=>
[
'task/JobTask/delHouseVideo'
,
[
'method'
=>
'get'
]],
//删除无效视频
'delHouseVideo'
=>
[
'task/JobTask/delHouseVideo'
,
[
'method'
=>
'get'
]],
//删除无效视频
'updateBargainPerformance'
=>
[
'task/ResultsSummaryNewTask/updateBargainPerformance'
,
[
'method'
=>
'get'
]],
//根据bargain_id统计
'updateBargainPerformance'
=>
[
'task/ResultsSummaryNewTask/updateBargainPerformance'
,
[
'method'
=>
'get'
]],
//根据bargain_id统计
'delAgent'
=>
[
'task/UpdateRedisCache/delAgent'
,
[
'method'
=>
'get'
]],
//清空经纪人缓存
'delCache'
=>
[
'task/UpdateRedisCache/delCache'
,
[
'method'
=>
'get'
]],
//清空多种缓存
'delGroup'
=>
[
'task/UpdateRedisCache/delGroup'
,
[
'method'
=>
'get'
]],
//批量去除角色缓存
]);
]);
Route
::
group
(
'broker'
,
[
Route
::
group
(
'broker'
,
[
...
...
application/task/controller/UpdateRedisCache.php
0 → 100644
View file @
8d842de7
<?php
/**
* Created by PhpStorm.
* User: 43897
* Date: 2019/4/9
* Time: 16:38
*/
namespace
app\task\controller
;
use
app\api_broker\service\RedisCacheService
;
use
app\model\AAgents
;
use
app\model\AuthGroup
;
use
think\Request
;
class
UpdateRedisCache
{
private
$redis_service
;
public
function
__construct
()
{
$this
->
redis_service
=
new
RedisCacheService
();
}
/**
* 批量去除经纪人缓存
*
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
delAgent
()
{
$m_agent
=
new
AAgents
();
$agent_data
=
$m_agent
->
getAgentById
(
'id'
,
[]);
foreach
(
$agent_data
as
$v
)
{
echo
$this
->
redis_service
->
delRedisCache
(
2
,
$v
[
'id'
]);
}
}
/**
* 删除多种缓存
*/
public
function
delCache
()
{
$param
=
Request
::
instance
()
->
param
();
echo
$this
->
redis_service
->
delRedisCache
(
$param
[
'type'
],
$param
[
'id'
]);
}
/**
* 批量去除角色缓存
*
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
delGroup
()
{
$m_group
=
new
AuthGroup
();
$group_data
=
$m_group
->
getList2
(
''
,
'id'
,[]);
foreach
(
$group_data
as
$v
)
{
echo
$this
->
redis_service
->
delRedisCache
(
3
,
$v
[
'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