浏览代码

addForceSubscribeUsers stats

zz 6 年之前
父节点
当前提交
76917beca9
共有 1 个文件被更改,包括 12 次插入2 次删除
  1. 12 2
      app/Modules/OfficialAccount/Services/ForceSubscribeService.php

+ 12 - 2
app/Modules/OfficialAccount/Services/ForceSubscribeService.php

@@ -267,6 +267,12 @@ class ForceSubscribeService
                     UserService::updateInfo($user['id'],$user);
                     UserService::updateInfo($user['id'],$user);
                     // UserService::addUser($user);
                     // UserService::addUser($user);
 
 
+                    // 新关统计
+                    \Log::info('addForceSubscribeUsers_redis_new:'.$forceSubscribeUsersPrams['uid']);
+                    $sub_key = 'gzh_new_sub:'.$forceSubscribeUsersPrams['appid'].':'.date('Y-m-d');
+                    Redis::SADD($sub_key,$forceSubscribeUsersPrams['uid']);
+                    Redis::EXPIRE($sub_key,24*3600*3);
+
                     return 1;
                     return 1;
 
 
                 } else {
                 } else {
@@ -293,9 +299,13 @@ class ForceSubscribeService
                     //\Log::info($user);
                     //\Log::info($user);
                     UserService::updateInfo($user['id'],$user);
                     UserService::updateInfo($user['id'],$user);
 
 
-                    return 1;
-
+                    // 老关统计
+                    \Log::info('addForceSubscribeUsers_redis_old:'.$forceSubscribeUsersPrams['uid']);
+                    $sub_key = 'gzh_old_sub:'.$forceSubscribeUsersPrams['appid'].':'.date('Y-m-d');
+                    Redis::SADD($sub_key,$forceSubscribeUsersPrams['uid']);
+                    Redis::EXPIRE($sub_key,24*3600*3);
 
 
+                    return 1;
                 }
                 }
 
 
             }
             }