|
@@ -103,6 +103,7 @@ class BookTest extends Command
|
|
|
foreach ($keys as $k){
|
|
|
$k_array = explode('_',$k);
|
|
|
$uv = Redis::scard('book_before_five_uv_'.$k);
|
|
|
+ Redis::del('book_before_five_uv_'.$k);
|
|
|
if(isset($book_name_arr[$k_array[1]]) && !empty($book_name_arr[$k_array[1]])){
|
|
|
$book_name = $book_name_arr[$k_array[1]];
|
|
|
}else{
|
|
@@ -131,6 +132,7 @@ class BookTest extends Command
|
|
|
}
|
|
|
}
|
|
|
DB::table('book_five_chapter_uv')->insert($data);
|
|
|
+ Redis::del('book_before_five_uvs');
|
|
|
}
|
|
|
|
|
|
public function data2(){
|
|
@@ -140,6 +142,7 @@ class BookTest extends Command
|
|
|
$i = 0;
|
|
|
foreach ($keys as $k){
|
|
|
$subscribe_uv = Redis::scard('subscribe_page_uv'.$k);
|
|
|
+ Redis::del('subscribe_page_uv'.$k);
|
|
|
$data[] = [
|
|
|
'send_order_id'=>$k,
|
|
|
'subscribe_uv'=>$subscribe_uv,
|
|
@@ -161,6 +164,7 @@ class BookTest extends Command
|
|
|
$keys = Redis::SMEMBERS('pay_page_uv_send_order_ids');
|
|
|
foreach ($keys as $v){
|
|
|
$pay_uv = Redis::scard('pay_page_uv'.$v);
|
|
|
+ Redis::del('pay_page_uv'.$v);
|
|
|
$o = DB::table('subscribe_pay_page_uv')->where('send_order_id',$v)->first();
|
|
|
if($o){
|
|
|
DB::table('subscribe_pay_page_uv')->where('send_order_id',$v)->update([
|
|
@@ -176,7 +180,8 @@ class BookTest extends Command
|
|
|
]);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ Redis::del('subscribe_page_uv_send_order_ids');
|
|
|
+ Redis::del('pay_page_uv_send_order_ids');
|
|
|
}
|
|
|
|
|
|
public function testTest(){
|
|
@@ -232,8 +237,8 @@ class BookTest extends Command
|
|
|
}
|
|
|
|
|
|
private function sendOrderStats105(){
|
|
|
- $sql1 = 'TRUNCATE send_order_stats_105';
|
|
|
- DB::update($sql1);
|
|
|
+ //$sql1 = 'TRUNCATE send_order_stats_105';
|
|
|
+ //DB::update($sql1);
|
|
|
$send_order_ids = Redis::hgetall('sendOrderIdToBid');
|
|
|
if(!$send_order_ids){
|
|
|
return ;
|
|
@@ -258,10 +263,12 @@ class BookTest extends Command
|
|
|
$key_1 = 'accurateSendOrderSubscribePageUv:bid:%s:sendorderid:'.$sendOrderId;
|
|
|
//强关页面uv
|
|
|
$subscribe_uv = (int)(Redis::scard(sprintf($key_1,$info->book_id)));
|
|
|
-
|
|
|
+ Redis::del( sprintf($key_1,$info->book_id) );
|
|
|
$key_2 = 'accurateSendOrderPayPageUv:bid:%s:send_order_id:'.$sendOrderId;
|
|
|
//付费页面UV
|
|
|
$pay_page_uv = (int)(Redis::scard(sprintf($key_2,$info->book_id)));
|
|
|
+
|
|
|
+ Redis::del( sprintf($key_2,$info->book_id) );
|
|
|
//强关数
|
|
|
$subscribe_num = DB::table('force_subscribe_users')
|
|
|
->where('send_order_id',$sendOrderId)
|
|
@@ -282,7 +289,11 @@ class BookTest extends Command
|
|
|
$send_order_chapter_sequence = $send_order_chapter_sequence_info->sequence;
|
|
|
}
|
|
|
if(!$subscribe_chaper_seq){
|
|
|
- $subscribe_chaper_seq = $book_info->force_subscribe_chapter_seq;
|
|
|
+ if($book_info){
|
|
|
+ $subscribe_chaper_seq = $book_info->force_subscribe_chapter_seq;
|
|
|
+ }else{
|
|
|
+ $subscribe_chaper_seq = 0;
|
|
|
+ }
|
|
|
}
|
|
|
$vip_seq = 0;
|
|
|
$vip_seq_info = Chapter::where('bid',$info->book_id)->where('is_vip',1)->orderBy('sequence')->select('sequence')->first();
|
|
@@ -293,14 +304,16 @@ class BookTest extends Command
|
|
|
for ($i = 1;$i<=30;$i++){
|
|
|
$key_3 = 'accurateSendOrderChapterUv:bid:%s:seq:%s:sendorderid:'.$sendOrderId;
|
|
|
$chapter_seq_uv = (int)(Redis::scard(sprintf($key_3,$info->book_id,$i)));
|
|
|
+
|
|
|
+ Redis::del( sprintf($key_3,$info->book_id,$i) );
|
|
|
if(!$chapter_seq_uv){
|
|
|
continue;
|
|
|
}
|
|
|
- $data[] = [
|
|
|
+ /*$data[] = [
|
|
|
'send_order_id'=>$sendOrderId,
|
|
|
'send_order_chapter_seq'=>$send_order_chapter_sequence,
|
|
|
'bid'=>$info->book_id,
|
|
|
- 'book_name'=>$book_info->book_name,
|
|
|
+ 'book_name'=>$book_info?$book_info->book_name:'xx',
|
|
|
'chaper_sequence'=>$i,
|
|
|
'chapter_uv'=>$chapter_seq_uv,
|
|
|
'subscribe_chaper_seq'=>$subscribe_chaper_seq,
|
|
@@ -311,7 +324,7 @@ class BookTest extends Command
|
|
|
'paid_user_num'=>$paid_user_num,
|
|
|
'created_at'=>date('Y-m-d H:i:s'),
|
|
|
'updated_at'=>date('Y-m-d H:i:s')
|
|
|
- ];
|
|
|
+ ];*/
|
|
|
}
|
|
|
if($data){
|
|
|
DB::table('send_order_stats_105')->insert($data);
|
|
@@ -324,6 +337,8 @@ class BookTest extends Command
|
|
|
one($send_order_id,$array[1]);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ Redis::del('sendOrderIdToBid');
|
|
|
}
|
|
|
|
|
|
private function you2(){
|