1
This commit is contained in:
parent
aa7fef8601
commit
f88de3bcdf
@ -851,14 +851,16 @@ class BattleDataService extends BaseService {
|
|||||||
)));
|
)));
|
||||||
$gold = $heroPvpCeg + $weaponPvpCeg1 + $weaponPvpCeg2;
|
$gold = $heroPvpCeg + $weaponPvpCeg1 + $weaponPvpCeg2;
|
||||||
if ($heroPvpCeg>0){
|
if ($heroPvpCeg>0){
|
||||||
$this->_addNftActive($this->heroDto,1);
|
// $this->_addNftActive($this->heroDto,1);
|
||||||
|
NftService::addNftActive($this->heroDto,1);
|
||||||
}
|
}
|
||||||
if ($weaponPvpCeg1>0){
|
if ($weaponPvpCeg1>0){
|
||||||
$this->_addNftActive($this->weapon1Dto,2);
|
// $this->_addNftActive($this->weapon1Dto,2);
|
||||||
|
NftService::addNftActive($this->weapon1Dto,2);
|
||||||
}
|
}
|
||||||
if ($weaponPvpCeg2>0){
|
if ($weaponPvpCeg2>0){
|
||||||
|
// $this->_addNftActive($this->weapon2Dto,2);
|
||||||
$this->_addNftActive($this->weapon2Dto,2);
|
NftService::addNftActive($this->weapon2Dto,2);
|
||||||
}
|
}
|
||||||
if ($gold > 0) {
|
if ($gold > 0) {
|
||||||
myself()->_addVirtualItem(V_ITEM_GOLD, $gold);
|
myself()->_addVirtualItem(V_ITEM_GOLD, $gold);
|
||||||
@ -1017,14 +1019,16 @@ class BattleDataService extends BaseService {
|
|||||||
)));
|
)));
|
||||||
$gold = $heroPveCeg + $weaponPveCeg1 + $weaponPveCeg2;
|
$gold = $heroPveCeg + $weaponPveCeg1 + $weaponPveCeg2;
|
||||||
if ($heroPveCeg>0){
|
if ($heroPveCeg>0){
|
||||||
$this->_addNftActive($this->heroDto,1);
|
// $this->_addNftActive($this->heroDto,1);
|
||||||
|
NftService::addNftActive($this->heroDto,1);
|
||||||
}
|
}
|
||||||
if ($weaponPveCeg1>0){
|
if ($weaponPveCeg1>0){
|
||||||
$this->_addNftActive($this->weapon1Dto,2);
|
// $this->_addNftActive($this->weapon1Dto,2);
|
||||||
|
NftService::addNftActive($this->weapon1Dto,2);
|
||||||
}
|
}
|
||||||
if ($weaponPveCeg2>0){
|
if ($weaponPveCeg2>0){
|
||||||
|
// $this->_addNftActive($this->weapon2Dto,2);
|
||||||
$this->_addNftActive($this->weapon2Dto,2);
|
NftService::addNftActive($this->weapon2Dto,2);
|
||||||
}
|
}
|
||||||
if ($gold > 0) {
|
if ($gold > 0) {
|
||||||
myself()->_addVirtualItem(V_ITEM_GOLD, $gold);
|
myself()->_addVirtualItem(V_ITEM_GOLD, $gold);
|
||||||
|
@ -988,6 +988,13 @@ class MissionService extends BaseService {
|
|||||||
myself()->_addVirtualItem(V_ITEM_GOLD, round($ceg,2));
|
myself()->_addVirtualItem(V_ITEM_GOLD, round($ceg,2));
|
||||||
$awardService->addItem(V_ITEM_GOLD, round($ceg,2));
|
$awardService->addItem(V_ITEM_GOLD, round($ceg,2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($totalHeroUpLimit>0){
|
||||||
|
NftService::addNftActive($heroDto,1);
|
||||||
|
}
|
||||||
|
if ($totalGunUpLimit>0){
|
||||||
|
NftService::addNftActive($gunDto,2);
|
||||||
|
}
|
||||||
$this->updateOfferRewardMission($missionId);
|
$this->updateOfferRewardMission($missionId);
|
||||||
$this->saveOfferRewardMission();
|
$this->saveOfferRewardMission();
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,16 @@
|
|||||||
|
|
||||||
namespace services;
|
namespace services;
|
||||||
|
|
||||||
|
require_once('models/Chip.php');
|
||||||
require_once('models/Nft.php');
|
require_once('models/Nft.php');
|
||||||
|
require_once('models/NftActive.php');
|
||||||
require_once('mt/Item.php');
|
require_once('mt/Item.php');
|
||||||
|
|
||||||
use phpcommon\SqlHelper;
|
use models\Chip;
|
||||||
|
use models\NftActive;
|
||||||
use models\Nft;
|
use models\Nft;
|
||||||
use mt\Item;
|
use mt\Item;
|
||||||
|
use phpcommon\SqlHelper;
|
||||||
|
|
||||||
class NftService extends BaseService {
|
class NftService extends BaseService {
|
||||||
|
|
||||||
@ -85,33 +89,66 @@ class NftService extends BaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// public static function addNft($itemId,$token_id){
|
public static function addNftActive($nftDb,$type){
|
||||||
// $itemMeta = Item::get($itemId);
|
if (!$nftDb){
|
||||||
// if ($itemMeta) {
|
return ;
|
||||||
// $tokenType = Nft::getTokenType($itemMeta);
|
}
|
||||||
// if ($tokenType == Nft::NONE_TYPE) {
|
switch ($type){
|
||||||
// myself()->_rspErr(1, 'param item_id error');
|
case Nft::HERO_TYPE:
|
||||||
// return false;
|
{
|
||||||
// } else {
|
$data = array(
|
||||||
// SqlHelper::insert(
|
'uniid' => $nftDb['hero_uniid'],
|
||||||
// myself()->_getMarketMysql(),
|
'token_id' => $nftDb['token_id'],
|
||||||
// 't_nft',
|
'token_type' => Nft::HERO_TYPE,
|
||||||
// array(
|
);
|
||||||
// 'token_id' => $token_id,
|
NftActive::upsert($data);
|
||||||
// 'token_type' => $tokenType,
|
if ($nftDb['chip_ids']){
|
||||||
// 'game_id' => 2006,
|
$chip_ids = explode("|",$nftDb['chip_ids']);
|
||||||
// 'item_id' => $itemId,
|
if (count($chip_ids)>0){
|
||||||
// 'owner_address' => myself()->_getOpenId(),
|
foreach ($chip_ids as $chip_id){
|
||||||
// 'createtime' => myself()->_getNowTime(),
|
$chipDb = Chip::getChipByIdx($chip_id);
|
||||||
// 'modifytime' => myself()->_getNowTime(),
|
self::addNftActive($chipDb,Nft::CHIP_TYPE);
|
||||||
// )
|
}
|
||||||
// );
|
}
|
||||||
// return true;
|
}
|
||||||
// }
|
}
|
||||||
// } else {
|
break;
|
||||||
// myself()->_rspErr(1, 'param item_id error');
|
case Nft::EQUIP_TYPE:
|
||||||
// return false;
|
{
|
||||||
// }
|
$data = array(
|
||||||
// }
|
'uniid' => $nftDb['gun_uniid'],
|
||||||
|
'token_id' => $nftDb['token_id'],
|
||||||
|
'token_type' => Nft::EQUIP_TYPE,
|
||||||
|
);
|
||||||
|
NftActive::upsert($data);
|
||||||
|
if ($nftDb['chip_ids']){
|
||||||
|
$chip_ids = explode("|",$nftDb['chip_ids']);
|
||||||
|
if (count($chip_ids)>0){
|
||||||
|
foreach ($chip_ids as $chip_id){
|
||||||
|
$chipDb = Chip::getChipByIdx($chip_id);
|
||||||
|
self::addNftActive($chipDb,Nft::CHIP_TYPE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Nft::CHIP_TYPE:
|
||||||
|
{
|
||||||
|
$data = array(
|
||||||
|
'uniid' => $nftDb['idx'],
|
||||||
|
'token_id' => $nftDb['token_id'],
|
||||||
|
'token_type' => Nft::CHIP_TYPE,
|
||||||
|
);
|
||||||
|
NftActive::upsert($data);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user