|
@@ -580,10 +580,13 @@ class BookTest extends Command
|
|
|
private function clearUserReadRecord(){
|
|
|
$i = 10000;
|
|
|
//$not_uid_key = ['last_read','send_order_id','sign_count','sign_counts','sign_info','sign_day','smart_push','inner_send_order_id','gxhp','property','bind_phone_status','ua'];
|
|
|
+ $k = 0;
|
|
|
while ( $i<108655782 ){
|
|
|
$last_read = ReadRecordService::getByField($i,'last_read');
|
|
|
if(!$last_read){
|
|
|
+ $k++;
|
|
|
Redis::del('book_read:'.$i);
|
|
|
+ continue;
|
|
|
}
|
|
|
$last_info = explode(',',explode('_',$last_read));
|
|
|
if(time()-$last_info[1]>=5*30*86400 ){
|
|
@@ -594,11 +597,13 @@ class BookTest extends Command
|
|
|
$data[] = ['uid'=>$i,'field'=>$k,'value'=>$item,
|
|
|
'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')];
|
|
|
}
|
|
|
+ $k++;
|
|
|
Redis::del('book_read:'.$i);
|
|
|
DB::table('read_record_from_redis')->insert($data);
|
|
|
}
|
|
|
$i++;
|
|
|
}
|
|
|
+ echo 'delete ' . $k . ' keys' . PHP_EOL;
|
|
|
}
|
|
|
|
|
|
}
|