|
@@ -75,7 +75,7 @@ class BookTest extends Command
|
|
//$this->transfromUserOrder();
|
|
//$this->transfromUserOrder();
|
|
//$this->clearUserReadRecord();
|
|
//$this->clearUserReadRecord();
|
|
//$this->deleteToLongReadRecord();
|
|
//$this->deleteToLongReadRecord();
|
|
- $this->testBookChapterStats();
|
|
|
|
|
|
+ $this->clearUserReadRecord();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -619,15 +619,15 @@ class BookTest extends Command
|
|
}
|
|
}
|
|
|
|
|
|
private function clearUserReadRecord(){
|
|
private function clearUserReadRecord(){
|
|
- $i = 10000;
|
|
|
|
|
|
+ $i = 137406313;
|
|
//$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'];
|
|
//$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;
|
|
$k = 0;
|
|
- while ( $i<108655782 ){
|
|
|
|
|
|
+ while ( $i<108655782){
|
|
$i++;
|
|
$i++;
|
|
$last_read = ReadRecordService::getByField($i,'last_read');
|
|
$last_read = ReadRecordService::getByField($i,'last_read');
|
|
if(!$last_read){
|
|
if(!$last_read){
|
|
$k++;
|
|
$k++;
|
|
- Redis::del('book_read:'.$i);
|
|
|
|
|
|
+ Redis::del('book_read:'.$i,'userRecommendBids:'.$i);
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
$last_info = explode('_',$last_read);
|
|
$last_info = explode('_',$last_read);
|
|
@@ -635,16 +635,16 @@ class BookTest extends Command
|
|
$k++;
|
|
$k++;
|
|
Redis::del('book_read:'.$i);
|
|
Redis::del('book_read:'.$i);
|
|
}
|
|
}
|
|
- if(time()-$last_info[2]>=5*30*86400 ){
|
|
|
|
|
|
+ if( (time()-$last_info[2]) >=2*30*86400 ){
|
|
$record = Redis::hgetall('book_read:'.$i);
|
|
$record = Redis::hgetall('book_read:'.$i);
|
|
$data = [];
|
|
$data = [];
|
|
|
|
|
|
- foreach ($record as $k=>$item){
|
|
|
|
- $data[] = ['uid'=>$i,'field'=>$k,'value'=>$item,
|
|
|
|
|
|
+ foreach ($record as $ks=>$item){
|
|
|
|
+ $data[] = ['uid'=>$i,'field'=>$ks,'value'=>$item,
|
|
'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')];
|
|
'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')];
|
|
}
|
|
}
|
|
$k++;
|
|
$k++;
|
|
- Redis::del('book_read:'.$i);
|
|
|
|
|
|
+ Redis::del('book_read:'.$i,'userRecommendBids:'.$i);
|
|
DB::table('read_record_from_redis')->insert($data);
|
|
DB::table('read_record_from_redis')->insert($data);
|
|
}
|
|
}
|
|
}
|
|
}
|