作者 邓超

预热脚本移入

... ... @@ -10,15 +10,19 @@ include_once "../vendor/autoload.php";
$one_month_ago = strtotime(date('Y-m-d', strtotime('-1 month')));
// 查询lists lists_hot
$id = 0;
$id = 389884523;
while (true){
$data = db()->first("select * from lists where id > {$id} and `is_hots` = 1 and `udate` < {$one_month_ago}");
$data = db()->first("select * from lists where id > {$id} and `is_hots` = 1 and `udate` < {$one_month_ago} limit 1;");
if($data){
$id = $data['id'];
db()->insert('list_hot', $data);
try {
db()->throw()->insert('lists_hot', $data);
} catch (\Exception $e) {
@file_put_contents('lists_to_lists_hot.data.error.log', json_encode($data)."\n", FILE_APPEND);
}
db()->delete('lists', ['id' => $data['id']]);
echo $id . " ok \n";
break;
// break;
}else{
sleep(5);
}
... ...