This commit is contained in:
hujiabin 2024-06-14 11:32:23 +08:00
parent 40c07d2a1b
commit 0f7ceebe23
2 changed files with 11 additions and 8 deletions

View File

@ -246,7 +246,7 @@ class Hero extends BaseModel {
'valid_time' => max(0, 'valid_time' => max(0,
86400 * $heroAtteMeta['validTime']), 86400 * $heroAtteMeta['validTime']),
'is_old' => $row['is_old'], 'is_old' => $row['is_old'],
"current_times" => myself()->_getDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,0), "current_times" => myself()->_getDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,$row['idx']),
"total_times" => $heroAtteMeta['roundPerDay'], "total_times" => $heroAtteMeta['roundPerDay'],
); );
@ -330,7 +330,7 @@ class Hero extends BaseModel {
'valid_time' => max(0, 'valid_time' => max(0,
86400 * $heroAtteMeta['validTime']), 86400 * $heroAtteMeta['validTime']),
'is_old' => $row['is_old'], 'is_old' => $row['is_old'],
"current_times" => myself()->_getDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,0), "current_times" => myself()->_getDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,$row['idx']),
"total_times" => $heroAtteMeta['roundPerDay'], "total_times" => $heroAtteMeta['roundPerDay'],
); );
@ -364,7 +364,7 @@ class Hero extends BaseModel {
'ability' => self::abilityInfo($row), 'ability' => self::abilityInfo($row),
'valid_time' => max(0, 'valid_time' => max(0,
86400 * $heroAtteMeta['validTime']), 86400 * $heroAtteMeta['validTime']),
"current_times" => myself()->_getDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,0), "current_times" => myself()->_getDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,$row['idx']),
"total_times" => $heroAtteMeta['roundPerDay'], "total_times" => $heroAtteMeta['roundPerDay'],
); );
} }

View File

@ -170,19 +170,22 @@ class RoomBattleDataService extends BaseService {
if (!$rewardMeta){ if (!$rewardMeta){
return ; return ;
} }
$heroTimes = myself()->_getDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,$heroDb['idx']);
$goldModeTimes = myself()->_getDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,0); $goldModeTimes = myself()->_getDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,0);
$heroMeta = \mt\Item::get($heroDb['hero_id']); $heroMeta = \mt\Item::get($heroDb['hero_id']);
$heroAtteMeta = mt\EconomyAttribute::findByGrade($heroMeta['relationship'],$heroDb['quality']); $heroAtteMeta = mt\EconomyAttribute::findByGrade($heroMeta['relationship'],$heroDb['quality']);
$maxTimes = $heroAtteMeta['roundPerDay']; $heroTimesMax = $heroAtteMeta['roundPerDay'];
if ($this->mapMode == mt\MapMode::GOLD_MODE){
myself()->_incDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,0,1);
}
//金币模式检验 //金币模式检验
if ($this->mapMode == mt\MapMode::GOLD_MODE && if ($this->mapMode == mt\MapMode::GOLD_MODE &&
// ($goldModeTimes >= $mapModeMeta['rewards_max_time'] )){ // ($goldModeTimes >= $mapModeMeta['rewards_max_time'] )){
(!Hero::verifyValid($heroDb) || $goldModeTimes >= $maxTimes )){ (!Hero::verifyValid($heroDb) || $heroTimes >= $heroTimesMax || $goldModeTimes >= $mapModeMeta['rewards_max_time'])){
error_log("金币模式:出战英雄没有打金时间或每日打金场次上限"); error_log("金币模式:出战英雄没有打金时间或每日打金场次上限");
}else{ }else{
if ($this->mapMode == mt\MapMode::GOLD_MODE){
myself()->_incDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,$heroDb['idx'],1);
myself()->_incDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,0,1);
}
if (!empty($rewardMeta['goldLoot'])){ if (!empty($rewardMeta['goldLoot'])){
$items = LootService::dropOutItem($rewardMeta['goldLoot']); $items = LootService::dropOutItem($rewardMeta['goldLoot']);
foreach ($items as $item){ foreach ($items as $item){