From 04c29493f637c04eb191aa2d0695d1fac9761706 Mon Sep 17 00:00:00 2001 From: filesite Date: Sun, 12 May 2024 22:51:08 +0800 Subject: [PATCH] save friends invite record --- plugins/Common.php | 6 +++++- themes/tajian/controller/FrontapiController.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/Common.php b/plugins/Common.php index 89c0f7b..948991b 100644 --- a/plugins/Common.php +++ b/plugins/Common.php @@ -32,7 +32,7 @@ Class Common { } //用户注册成功后,保存他的手机号码 6 位尾号作为邀请码 - public static function saveFriendsCode($cellphone) { + public static function saveFriendsCode($cellphone, $friends_code) { $logTime = date('Y-m-d H:i:s'); $logDir = __DIR__ . '/../runtime/friendscode/'; $logFilename = substr($cellphone, -6) . '.log'; @@ -41,6 +41,10 @@ Class Common { @mkdir($logDir, 0700, true); @error_log("{$logTime} created by {$cellphone}\n", 3, "{$logDir}{$logFilename}"); } + + //保存邀请记录 + $friendsLogfile = "{$friends_code}.log"; + $logOk = @error_log("{$logTime} invite {$cellphone}\n", 3, "{$logDir}{$friendsLogfile}"); } //初始化用户数据目录 diff --git a/themes/tajian/controller/FrontapiController.php b/themes/tajian/controller/FrontapiController.php index 389509a..cadc2a0 100644 --- a/themes/tajian/controller/FrontapiController.php +++ b/themes/tajian/controller/FrontapiController.php @@ -667,7 +667,7 @@ eof; if (empty($userDataDir)) { $newUser = Common::saveUserIntoSession($cellphone, $friends_code); if (!empty($newUser)) { - Common::saveFriendsCode($cellphone); + Common::saveFriendsCode($cellphone, $friends_code); Common::initUserData($cellphone, $friends_code); //更新统计数据