Browse Source

save friends invite record

master
filesite 7 months ago
parent
commit
04c29493f6
  1. 6
      plugins/Common.php
  2. 2
      themes/tajian/controller/FrontapiController.php

6
plugins/Common.php

@ -32,7 +32,7 @@ Class Common { @@ -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 { @@ -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}");
}
//初始化用户数据目录

2
themes/tajian/controller/FrontapiController.php

@ -667,7 +667,7 @@ eof; @@ -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);
//更新统计数据

Loading…
Cancel
Save