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
39da806f
Commit
39da806f
authored
May 08, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定时异常处理
parent
9637d40a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
18 deletions
+32
-18
SquareTask.php
application/task/controller/SquareTask.php
+32
-18
No files found.
application/task/controller/SquareTask.php
View file @
39da806f
...
@@ -7,6 +7,7 @@ namespace app\task\controller;
...
@@ -7,6 +7,7 @@ namespace app\task\controller;
use
app\api_broker\service\SquareSortService
;
use
app\api_broker\service\SquareSortService
;
use
app\model\BSquare
;
use
app\model\BSquare
;
use
app\model\BSquareSort
;
use
app\model\BSquareSort
;
use
think\Log
;
class
SquareTask
class
SquareTask
{
{
...
@@ -18,6 +19,12 @@ class SquareTask
...
@@ -18,6 +19,12 @@ class SquareTask
$this
->
m_square
=
new
BSquare
();
$this
->
m_square
=
new
BSquare
();
}
}
/**
* 备份redis开盘排序
*
* User HuJun
* Date 19-5-8 上午10:09
*/
public
function
squareBackUp
()
{
public
function
squareBackUp
()
{
$save_data
=
$square_id
=
[];
$save_data
=
$square_id
=
[];
...
@@ -42,29 +49,35 @@ class SquareTask
...
@@ -42,29 +49,35 @@ class SquareTask
$square_id
=
array_unique
(
$square_id
);
$square_id
=
array_unique
(
$square_id
);
sort
(
$square_id
);
sort
(
$square_id
);
foreach
(
$square_id
as
$k
=>
$v
)
{
try
{
if
(
isset
(
$look_num
[
$v
]))
{
foreach
(
$square_id
as
$k
=>
$v
)
{
$save_data
[
'browse_number'
]
=
$look_num
[
$v
];
if
(
isset
(
$look_num
[
$v
]))
{
$save_data
[
'browse_number'
]
=
$look_num
[
$v
];
if
(
$look_num
[
$v
]
>=
500
)
{
if
(
$look_num
[
$v
]
>=
500
)
{
$square_data
=
$this
->
m_square
->
getSquare
(
'id,is_cream'
,[
'id'
=>
$v
]);
$square_data
=
$this
->
m_square
->
getSquare
(
'id,is_cream'
,[
'id'
=>
$v
]);
//是否是精华帖 0普通 1精华
//是否是精华帖 0普通 1精华
if
(
$square_data
[
0
][
'is_cream'
]
==
0
)
{
if
(
$square_data
[
0
][
'is_cream'
]
==
0
)
{
$this
->
m_square
->
updateStatus
([
'id'
=>
$v
],
[
'is_cream'
=>
1
]);
$this
->
m_square
->
updateStatus
([
'id'
=>
$v
],
[
'is_cream'
=>
1
]);
}
}
}
}
}
}
if
(
isset
(
$comment
[
$v
]))
{
if
(
isset
(
$comment
[
$v
]))
{
$save_data
[
'last_reply_time'
]
=
date
(
'Y-m-d H:i:s'
,
$comment
[
$v
]);
$save_data
[
'last_reply_time'
]
=
date
(
'Y-m-d H:i:s'
,
$comment
[
$v
]);
}
}
$num
=
$this
->
m_sort
->
getList
(
1
,
1
,
''
,
'id'
,[
'square_id'
=>
$v
,
'is_del'
=>
0
]);
$num
=
$this
->
m_sort
->
getList
(
1
,
1
,
''
,
'id'
,[
'square_id'
=>
$v
,
'is_del'
=>
0
]);
if
(
$num
)
{
if
(
$num
)
{
$this
->
m_sort
->
updateData
(
$save_data
,
$num
[
0
][
'id'
]);
$this
->
m_sort
->
updateData
(
$save_data
,
$num
[
0
][
'id'
]);
}
else
{
}
else
{
$save_data
[
'square_id'
]
=
$v
;
$save_data
[
'square_id'
]
=
$v
;
$this
->
m_sort
->
insertData
(
$save_data
);
$this
->
m_sort
->
insertData
(
$save_data
);
}
}
}
}
catch
(
\Exception
$e
)
{
Log
::
write
(
$e
->
getMessage
(),
'redis_backUp_square_task'
);
//记录日志
}
}
return
;
}
}
}
}
\ 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