私域操盘手 - 重构账号权限加友限制组件化用于计划任务单日加友限制

This commit is contained in:
柳清爽
2025-05-15 10:50:28 +08:00
parent 916c39d737
commit 2fec134ad7
11442 changed files with 52 additions and 2997692 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace AccountWeight;
use library\interfaces\WechatAccountWeightAssessment as WechatAccountWeightAssessmentInterface;
use library\interfaces\WechatFriendAddLimitAssessment as WechatFriendAddLimitAssessmentInterface;
class WechatFriendAddLimitAssessment implements WechatFriendAddLimitAssessmentInterface
{
/**
* @inheritDoc
*/
public function maxLimit(WechatAccountWeightAssessmentInterface $weight): int
{
$adjusted = $scope = $weight->getWeightScope();
$lastDigit = $scope % 10;
if ($scope < 10) {
$adjusted = $lastDigit < 5 ? 5 : 10;
}
// 每5权重=1好友最多20个
return min(20, floor($adjusted / 5));
}
}