From 0f3a63a7796c5d19adce4af893757e84ab823a66 Mon Sep 17 00:00:00 2001 From: hujiabin Date: Thu, 23 Feb 2023 15:31:15 +0800 Subject: [PATCH] 1 --- doc/_common.py | 3 +++ webapp/controller/GunController.class.php | 7 +++++++ webapp/controller/HeroController.class.php | 7 +++++++ webapp/models/Chip.php | 1 + webapp/models/Gun.php | 3 +++ webapp/models/Hero.php | 3 +++ 6 files changed, 24 insertions(+) diff --git a/doc/_common.py b/doc/_common.py index c85902af..fc7d9fe5 100644 --- a/doc/_common.py +++ b/doc/_common.py @@ -100,6 +100,7 @@ class Gun(object): ['pvp_ceg_uplimit', 0, 'pvp获取的ceg的上限'], ['pve_ceg_uplimit', 0, 'pve获取的ceg的上限'], ['offer_reward_state', 0, '是否悬赏中'], + ['tags', '', '1:Gen状态'], ] class GunSkin(object): @@ -265,6 +266,7 @@ class Hero(object): ['pvp_ceg_uplimit', 0, 'pvp获取的ceg的上限'], ['pve_ceg_uplimit', 0, 'pve获取的ceg的上限'], ['offer_reward_state', 0, '是否悬赏中'], + ['tags', '', '1:Gen状态'], ] @@ -802,6 +804,7 @@ class Chip(object): ['supper_state', 0, '是否锁定:0 正常;1 锁住 ---弃用字段'], ['inlay_state', 0, '镶嵌状态:0 未镶嵌;1 镶嵌了 ---弃用字段'], ['!rand_attr', [ChipAttr()], '属性'], + ['tags', '', '1:Gen状态'], ] class ChipPro(object): diff --git a/webapp/controller/GunController.class.php b/webapp/controller/GunController.class.php index 8058a0d5..dba9c355 100644 --- a/webapp/controller/GunController.class.php +++ b/webapp/controller/GunController.class.php @@ -11,6 +11,7 @@ require_once('models/User.php'); require_once('models/Gun.php'); require_once('models/Bag.php'); require_once('models/Chip.php'); +require_once('models/Nft.php'); require_once('models/NftUpReceive.php'); require_once('models/Transaction.php'); @@ -26,6 +27,7 @@ use models\User; use models\Gun; use models\Bag; use models\Chip; +use models\Nft; use models\NftUpReceive; use models\Transaction; use services\LogService; @@ -61,6 +63,11 @@ class GunController extends BaseAuthedController { $this->_rspErr(1, "You don't have the gun yet"); return; } + $gunDb['tags'] = ''; + if ($gunDb['token_id']){ + $nftDb = Nft::getNft($gunDb['token_id']); + $gunDb['tags'] = $nftDb['tags']; + } $gun = Gun::toDto($gunDb); $this->_rspData(array( diff --git a/webapp/controller/HeroController.class.php b/webapp/controller/HeroController.class.php index 65cec0e5..95947538 100644 --- a/webapp/controller/HeroController.class.php +++ b/webapp/controller/HeroController.class.php @@ -15,6 +15,7 @@ require_once('models/Hero.php'); require_once('models/Bag.php'); require_once('models/HeroSkin.php'); require_once('models/Chip.php'); +require_once('models/Nft.php'); require_once('models/NftUpReceive.php'); require_once('models/Transaction.php'); @@ -30,6 +31,7 @@ use models\Hero; use models\Bag; use models\HeroSkin; use models\Chip; +use models\Nft; use models\NftUpReceive; use models\Transaction; use services\LogService; @@ -59,6 +61,11 @@ class HeroController extends BaseAuthedController { $this->_rspErr(1, "You don't have the hero yet"); return; } + $heroDb['tags'] = ''; + if ($heroDb['token_id']){ + $nftDb = Nft::getNft($heroDb['token_id']); + $heroDb['tags'] = $nftDb['tags']; + } $hero = Hero::toDto($heroDb); $this->_rspData(array( diff --git a/webapp/models/Chip.php b/webapp/models/Chip.php index 7edb744a..38c1e38c 100644 --- a/webapp/models/Chip.php +++ b/webapp/models/Chip.php @@ -180,6 +180,7 @@ class Chip extends BaseModel $nft_address = SERVER_ENV == _ONLINE ? '0x73482411443E87CAC124C12A10B34e9Aaa2De168' : '0x26b4AFb60d6C903165150C6F0AA14F8016bE4aec'; } $dto['nft_address'] = $nft_address; + $dto['tags'] = ''; return $dto; } diff --git a/webapp/models/Gun.php b/webapp/models/Gun.php index 1da5e03d..9c2d4d25 100644 --- a/webapp/models/Gun.php +++ b/webapp/models/Gun.php @@ -156,6 +156,7 @@ class Gun extends BaseModel { 'account_id' => myself()->_getAccountId() ), function ($row) use($cb) { + $row['tags'] = ''; $cb($row); } ); @@ -195,6 +196,7 @@ class Gun extends BaseModel { ) ); } + $row['tags'] = $nftDb['tags']; $cb($row); } } @@ -303,6 +305,7 @@ class Gun extends BaseModel { 'chip_strength_sum' => strval(Chip::getChipMaxStrength($row['chip_ids'],2)), //计算ceg上限所需参数 'offer_reward_state' => 0, 'labour' => $row['labour'], + 'tags' => $row['tags'], ); $dto['durability_max'] = strval(round(FormulaService::Weapon_NFT_Maximum_Durability($dto['quality'],$dto['lucky']),3)); $dto['pvp_ceg_uplimit'] = strval( round(FormulaService::getWeaponPvpDailyCegUpLimit($dto),2) ); diff --git a/webapp/models/Hero.php b/webapp/models/Hero.php index 0912e944..fce7fd33 100644 --- a/webapp/models/Hero.php +++ b/webapp/models/Hero.php @@ -146,6 +146,7 @@ class Hero extends BaseModel { 'account_id' => myself()->_getAccountId() ), function ($row) use($cb) { + $row['tags'] = ''; $cb($row); } ); @@ -185,6 +186,7 @@ class Hero extends BaseModel { ) ); } + $row['tags'] = $nftDb['tags']; $cb($row); } } @@ -309,6 +311,7 @@ class Hero extends BaseModel { 'skill_points' => $row['skill_points'], 'offer_reward_state' => 0, 'labour' => $row['labour'], + 'tags' => $row['tags'], ); $dto['hero_tili_max'] = strval(round(FormulaService::Hero_NFT_Maximum_Physical_Strength($dto['quality'],$dto['lucky']),3)); $dto['pvp_ceg_uplimit'] =strval( round(FormulaService::getHeroPvpDailyCegUpLimit($dto),2) );