diff --git a/config/env/torrents.js b/config/env/torrents.js index af430f1d..c2db6b15 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -601,10 +601,6 @@ module.exports = { * * @levelStep: value of each level step, default 500 * @scoreLogDays: setting of days to write score detail log to db, because the data is too more too big, do not to set a big value - * @transfer: setting of transfer score to inviter per month - * @enable: setting whether to enable transfer - * @deductFromUser: setting whether deduct the score from user - * @transRatio: setting transfer ratio, the user`s score of this ratio will be subtract and add into the inviter`s account if the @deductFromUser is true * @action: score change action list * @name: action name * @value: action score value @@ -614,18 +610,10 @@ module.exports = { score: { levelStep: 1000, scoreLogDays: 10, - transferToInviter: { - enable: true, - deductFromUser: false, - transRatio: 0.001 - }, action: { defaultAction: {name: 'defaultAction', content: 'DEFAULT_ACTION', value: 0, enable: true}, adminModify: {name: 'adminModify', content: 'ADMIN_MODIFY', value: 0, enable: true}, - transferScoreIntoInviterFrom: {name: 'transferScoreIntoInviterFrom', content: 'TRANSFER_SCORE_INTO_INVITER_FROM', value: 0, enable: true}, - transferScoreIntoInviterTo: {name: 'transferScoreIntoInviterTo', content: 'TRANSFER_SCORE_INTO_INVITER_TO', value: 0, enable: true}, - uploadTorrent: {name: 'uploadTorrent', content: 'UPLOAD_TORRENT', value: 20, enable: true}, uploadTorrentBeDeleted: {name: 'uploadTorrentBeDeleted', content: 'UPLOAD_TORRENT_BE_DELETED', value: -20, enable: true}, uploadTorrentBeRecommend: {name: 'uploadTorrentBeRecommend', content: 'UPLOAD_TORRENT_BE_RECOMMEND', value: 5, enable: true}, diff --git a/config/lib/cron-job.js b/config/lib/cron-job.js index c07edb5b..49e9d1e7 100644 --- a/config/lib/cron-job.js +++ b/config/lib/cron-job.js @@ -92,10 +92,6 @@ module.exports = function (app) { cronJobs.push(countUsersHnrWarning()); } - if (scoreConfig.transferToInviter.enable) { - cronJobs.push(transferUserScoreToInviter()); - } - if (supportConfig.mailTicketSupportService) { cronJobs.push(listenServiceEmail()); } @@ -385,66 +381,6 @@ function countUsersHnrWarning() { return cronJob; } -/** - * transferUserScoreToInviter - */ -function transferUserScoreToInviter() { - var cronJob = new CronJob({ - cronTime: '00 00 2 1 * *', - onTick: function () { - logger.info(chalk.green('transferUserScoreToInviter: process!')); - - var mom = moment().utcOffset(appConfig.dbTimeZone); - var y = mom.get('year'); - var m = mom.get('month') + 1; - - UserMonthsLog.find({ - year: y, - month: m - 1 - }).populate({ - path: 'user', - select: 'username displayName profileImageURL isVip score uploaded downloaded invited_by', - populate: { - path: 'invited_by', - select: 'username displayName profileImageURL isVip score uploaded downloaded' - } - }).exec(function (err, logs) { - if (logs) { - logs.forEach(function (l) { - if (l.score > 0 && l.user.invited_by) { - var transValue = Math.round(l.score * scoreConfig.transferToInviter.transRatio * 100) / 100; - - if (transValue > 0) { - if (scoreConfig.transferToInviter.deductFromUser) { - var actFrom = scoreConfig.action.transferScoreIntoInviterFrom; - actFrom.params = { - uid: l.user.invited_by._id, - uname: l.user.invited_by.displayName - }; - scoreUpdate(undefined, l.user, actFrom, -(transValue)); - } - - var actTo = scoreConfig.action.transferScoreIntoInviterTo; - actTo.params = { - uid: l.user._id, - uname: l.user.displayName - }; - scoreUpdate(undefined, l.user.invited_by, actTo, transValue); - } - } - }); - } - }); - }, - start: false, - timeZone: appConfig.cronTimeZone - }); - - cronJob.start(); - - return cronJob; -} - /** * listenServiceEmail */ diff --git a/modules/about/client/templates/invitations-rules-en.md b/modules/about/client/templates/invitations-rules-en.md index 0c5685fd..68e56978 100644 --- a/modules/about/client/templates/invitations-rules-en.md +++ b/modules/about/client/templates/invitations-rules-en.md @@ -23,10 +23,6 @@ invite.banUserInviter = %(inviteConfig.banUserInviter)s ``` 1. If you have made outstanding contributions to the site, the site will occasionally send you a limited number of invitations to reward you for your contribution. -1. At the end of each month, the system will award scores to users who have successfully sent invitations. the score number limit is the percentage `%(scoreConfig.transferToInviter.transRatio)f` of the monthly got of the invited users, the current award function enable status is: -```javascript -scoreConfig.transferToInviter.enable = %(scoreConfig.transferToInviter.enable)s -```   diff --git a/modules/about/client/templates/invitations-rules-zh-tw.md b/modules/about/client/templates/invitations-rules-zh-tw.md index 49b4c653..e5ab3d68 100644 --- a/modules/about/client/templates/invitations-rules-zh-tw.md +++ b/modules/about/client/templates/invitations-rules-zh-tw.md @@ -23,10 +23,6 @@ invite.banUserInviter = %(inviteConfig.banUserInviter)s ``` 1. 如果您對站點做出了突出貢獻,站內會不定期根據您的貢獻向您贈送一定數量的邀請以做為獎勵。 -1. 系統在每個月底會對成功發送過邀請函的用戶進行積分獎勵,獎勵額度為受邀請用戶當月的進帳積分的 `%(scoreConfig.transferToInviter.transRatio)f` 倍,目前該獎勵功能開關狀態為: -```javascript -scoreConfig.transferToInviter.enable = %(scoreConfig.transferToInviter.enable)s -```   diff --git a/modules/about/client/templates/invitations-rules-zh.md b/modules/about/client/templates/invitations-rules-zh.md index 183090bc..c383d0b3 100644 --- a/modules/about/client/templates/invitations-rules-zh.md +++ b/modules/about/client/templates/invitations-rules-zh.md @@ -23,10 +23,6 @@ invite.banUserInviter = %(inviteConfig.banUserInviter)s ``` 1. 如果您对站点做出了突出贡献,站内会不定期根据您的贡献向您赠送一定数量的邀请以做为奖励。 -1. 系统在每个月底会对成功发送过邀请函的用户进行积分奖励,奖励额度为受邀请用户当月的进帐积分的 `%(scoreConfig.transferToInviter.transRatio)f` 倍,目前该奖励功能开关状态为: -```javascript -scoreConfig.transferToInviter.enable = %(scoreConfig.transferToInviter.enable)s -```   diff --git a/modules/about/client/templates/score-rules-en.md b/modules/about/client/templates/score-rules-en.md index 84d756d9..07ade001 100644 --- a/modules/about/client/templates/score-rules-en.md +++ b/modules/about/client/templates/score-rules-en.md @@ -45,10 +45,6 @@ The basic ratio is %(scoreConfig.action.seedSeederAndLife.lifeBasicRatio).2f, increase %(scoreConfig.action.seedSeederAndLife.lifeCoefficientOfDay).3f every day. For 10 days life ratio is 1.01, [100 days is 1.1], [200 days is 1.2] etc, the max ratio is %(scoreConfig.action.seedSeederAndLife.lifeMaxRatio).2f. ``` -* At the end of each month, the system will award scores to users who have successfully sent invitations. the score number limit is the percentage `%(scoreConfig.transferToInviter.transRatio)f` of the monthly got of the invited users, the current award function enable status is: -```javascript -scoreConfig.transferToInviter.enable = %(scoreConfig.transferToInviter.enable)s -```   diff --git a/modules/about/client/templates/score-rules-zh-tw.md b/modules/about/client/templates/score-rules-zh-tw.md index 30d4aa2a..877bc715 100644 --- a/modules/about/client/templates/score-rules-zh-tw.md +++ b/modules/about/client/templates/score-rules-zh-tw.md @@ -45,10 +45,6 @@ 加成基礎係數為 %(scoreConfig.action.seedSeederAndLife.lifeBasicRatio).2f, 根據種子生命每天增加 %(scoreConfig.action.seedSeederAndLife.lifeCoefficientOfDay).3f。 如果種子生命(釋出時間)為 10 天,則加成係數為 1.01, [100 天是 1.1], [200 天是 1.2], 以此類推,最大加成係數為 %(scoreConfig.action.seedSeederAndLife.lifeMaxRatio).2f。 ``` -* 系統在每個月底會對成功發送過邀請函的用戶進行積分獎勵,獎勵額度為受邀請用戶當月的進帳積分的 `%(scoreConfig.transferToInviter.transRatio)f` 倍,目前該獎勵功能開關狀態為: -```javascript -scoreConfig.transferToInviter.enable = %(scoreConfig.transferToInviter.enable)s -```   diff --git a/modules/about/client/templates/score-rules-zh.md b/modules/about/client/templates/score-rules-zh.md index 31ee03fc..eadeca72 100644 --- a/modules/about/client/templates/score-rules-zh.md +++ b/modules/about/client/templates/score-rules-zh.md @@ -45,10 +45,6 @@ 加成基础系数为 %(scoreConfig.action.seedSeederAndLife.lifeBasicRatio).2f, 根据种子生命每天增加 %(scoreConfig.action.seedSeederAndLife.lifeCoefficientOfDay).3f。 如果种子生命(发布时间)为 10 天,则加成系数为 1.01, [100 天是 1.1], [200 天是 1.2], 以此类推,最大加成系数为 %(scoreConfig.action.seedSeederAndLife.lifeMaxRatio).2f。 ``` -* 系统在每个月底会对成功发送过邀请函的用户进行积分奖励,奖励额度为受邀请用户当月的进帐积分的 `%(scoreConfig.transferToInviter.transRatio)f` 倍,目前该奖励功能开关状态为: -```javascript -scoreConfig.transferToInviter.enable = %(scoreConfig.transferToInviter.enable)s -```   diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 624ab961..769edeb6 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -1649,8 +1649,6 @@ SCORE_LOG: { DEFAULT_ACTION: 'Undefined events increased score', ADMIN_MODIFY: 'Administrator {{uname}} modify score', - TRANSFER_SCORE_INTO_INVITER_FROM: 'Transfer score of last month to your inviter {{uname}}', - TRANSFER_SCORE_INTO_INVITER_TO: 'The system increased the score reward of last month by invited user {{uname}}', UPLOAD_TORRENT: 'Uploaded torrent was reviewed {{tid}}', UPLOAD_TORRENT_BE_DELETED: 'Uploaded torrent was deleted {{tid}}', UPLOAD_TORRENT_BE_RECOMMEND: 'Uploaded torrent was recommended {{tid}}', diff --git a/modules/core/client/app/trans-string-zh-tw.js b/modules/core/client/app/trans-string-zh-tw.js index 7f2fb01f..fb086386 100644 --- a/modules/core/client/app/trans-string-zh-tw.js +++ b/modules/core/client/app/trans-string-zh-tw.js @@ -1649,8 +1649,6 @@ SCORE_LOG: { DEFAULT_ACTION: '未知事件獲得的積分', ADMIN_MODIFY: '管理員 {{uname}} 修改積分', - TRANSFER_SCORE_INTO_INVITER_FROM: '結算上個月的積分給您的邀請人 {{uname}}', - TRANSFER_SCORE_INTO_INVITER_TO: '系統發放被邀請用戶 {{uname}} 上個月的積分獎勵', UPLOAD_TORRENT: '上傳的種子被審核通過 {{tid}}', UPLOAD_TORRENT_BE_DELETED: '上傳的種子被刪除 {{tid}}', UPLOAD_TORRENT_BE_RECOMMEND: '上傳的種子被置頂 {{tid}}', diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index 6e6a4187..b5dfdf8b 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -1649,8 +1649,6 @@ SCORE_LOG: { DEFAULT_ACTION: '未知事件获得的积分', ADMIN_MODIFY: '管理员 {{uname}} 修改积分', - TRANSFER_SCORE_INTO_INVITER_FROM: '结算上个月的积分给您的邀请人 {{uname}}', - TRANSFER_SCORE_INTO_INVITER_TO: '系统发放被邀请用户 {{uname}} 上个月的积分奖励', UPLOAD_TORRENT: '上传的种子被审核通过 {{tid}}', UPLOAD_TORRENT_BE_DELETED: '上传的种子被删除 {{tid}}', UPLOAD_TORRENT_BE_RECOMMEND: '上传的种子被置顶 {{tid}}',