getRegisterDate($wechatId)); $interval = date_diff($currentData, $registerDate); return $interval->y * 12 + $interval->m; } /** * @inheritDoc */ public function settingFactor($wechatId): WechatAccountWeightResultSetInterface { $cha = ceil($this->getDateTimeDiff($wechatId) / 60) * 100; // 规定账号年龄五年起拥有最高权重 $this->weight = $cha > 100 ? 100 : $cha; return $this; } /** * @inheritDoc */ public function getResult(): int { return $this->weight ?: 0; } }