This commit is contained in:
aozhiwei 2022-05-08 23:09:57 +08:00
parent 57ccf77ce5
commit 3a774c7c13
3 changed files with 3 additions and 3 deletions

View File

@ -261,9 +261,9 @@ class Gun extends BaseModel {
public static function gainGold($gunDto, $addGold)
{
$finalyAddGold = 0;
$goldLimit = 0;
$gunQualityMeta = mt\GunQuality::getByQuality($gunDto['quality']);
if ($gunQualityMeta) {
$goldLimit = $gunQualityMeta['gold_limit'];
$attr = mt\AttrHelper::getAbsVal($gunDto['attr'], kHAT_LUCKY);
if ($attr) {
$goldLimit += $attr['val'];

View File

@ -309,9 +309,9 @@ class Hero extends BaseModel {
public static function gainGold($heroDto, $addGold)
{
$finalyAddGold = 0;
$goldLimit = 0;
$heroQualityMeta = mt\HeroQuality::getByQuality($heroDto['quality']);
if ($heroQualityMeta) {
$goldLimit = $heroQualityMeta['gold_limit'];
$attr = mt\AttrHelper::getAbsVal($heroDto['attr'], kHAT_LUCKY);
if ($attr) {
$goldLimit += $attr['val'];

View File

@ -365,7 +365,7 @@ class BattleDataService extends BaseService {
$weaponUniid = getReqVal('weapon_uuid' . $i, 0);
if ($weaponUniid) {
$row = Gun::find($weaponUniid);
$gunDto = $gunDb ? Gun::toDto($row) : null;
$gunDto = $row ? Gun::toDto($row) : null;
if ($gunDto){
$finalyAddGold += Gun::gainGold($gunDto, $addGold);
}