为FarmRankItem属性增加财富值(fund - 2),等级排行榜和财富排行榜都有,增加数据的读取。
app/Module/Farm/Dtos/HouseRankItemDto.php - 房屋排行榜DTO增加财富值属性app/Module/Farm/Logics/HouseLogic.php - 更新房屋排行榜数据查询逻辑app/Module/AppGame/Proto/HouseRankDto.php - 更新房屋排行榜Protobuf转换app/Module/AppGame/Proto/WealthRankDto.php - 更新财富排行榜Protobuf转换public int $wealth = 0 - 财富值(钻石余额)f.fund_id = 2 (钻石资金类型)f.balance 字段$rankItem->setFund2($item->wealth)$rankItem->setLevel($item->level) 仍为房屋等级$rankItem->setLevel($item->houseLevel) 设置为房屋等级$rankItem->setFund2($item->wealth) 设置财富值$rankItem->setNickname($item->nickname) 使用正确的昵称-- 房屋排行榜查询(新增财富值)
SELECT
fu.user_id,
fu.house_level,
u.nickname,
fu.last_upgrade_time,
f.balance -- 新增财富值字段
FROM farm_users fu
JOIN user_infos u ON fu.user_id = u.user_id
LEFT JOIN fund f ON fu.user_id = f.user_id AND f.fund_id = 2
ORDER BY fu.house_level DESC, fu.last_upgrade_time ASC
LIMIT 100
public function __construct(
int $rank = 0,
int $level = 0,
int $wealth = 0, // 新增财富值参数
int $userId = 0,
string $nickname = '',
int $reason = 1
) {
$this->rank = $rank;
$this->level = $level;
$this->wealth = $wealth; // 设置财富值
$this->userId = $userId;
$this->nickname = $nickname;
$this->reason = $reason;
}
private static function convertRankItem(HouseRankItemDto $item): FarmRankItem
{
$rankItem = new FarmRankItem();
$rankItem->setRank($item->rank);
$rankItem->setLevel($item->level); // 房屋等级
$rankItem->setUserId($item->userId);
$rankItem->setNickname($item->nickname);
$rankItem->setReason($item->reason);
$rankItem->setFund2($item->wealth); // 财富值
return $rankItem;
}
e3acb952