1
This commit is contained in:
parent
2e24daa285
commit
858296991e
@ -379,7 +379,7 @@ class Hero extends BaseModel {
|
|||||||
if ($count <= 0) {
|
if ($count <= 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
$finalyAddGold = self::calcPveGainGold($gunDto, $count);
|
$finalyAddGold = self::calcPveGainGold($heroDto, $count);
|
||||||
if ($finalyAddGold > 0) {
|
if ($finalyAddGold > 0) {
|
||||||
self::update($heroDto['hero_uniid'],
|
self::update($heroDto['hero_uniid'],
|
||||||
array(
|
array(
|
||||||
@ -390,15 +390,15 @@ class Hero extends BaseModel {
|
|||||||
return $finalyAddGold;
|
return $finalyAddGold;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function calcPveGainGold($gunDto, $count)
|
public static function calcPveGainGold($heroDto, $count)
|
||||||
{
|
{
|
||||||
if ($count <= 0) {
|
if ($count <= 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
$newGold = min($gunDto['pve_ceg_uplimit'],
|
$newGold = min($heroDto['pve_ceg_uplimit'],
|
||||||
$gunDto['today_pve_get_ceg'] +
|
$heroDto['today_pve_get_ceg'] +
|
||||||
round($gunDto['pve_ceg_uplimit'] / $count));
|
round($heroDto['pve_ceg_uplimit'] / $count));
|
||||||
$finalyAddGold = max(0, $newGold - $gunDto['today_pve_get_ceg']);
|
$finalyAddGold = max(0, $newGold - $heroDto['today_pve_get_ceg']);
|
||||||
return $finalyAddGold;
|
return $finalyAddGold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user