移除或者注释代码里所有往t_nft表里插数据的代码

This commit is contained in:
hujiabin 2022-11-03 15:07:50 +08:00
parent 1fdf197677
commit 28e40777c6
15 changed files with 284 additions and 282 deletions

View File

@ -334,21 +334,22 @@ class BagController extends BaseAuthedController {
} }
private function openFragmentBox($itemDb, $itemMeta, $itemNum){ private function openFragmentBox($itemDb, $itemMeta, $itemNum){
if ($itemDb['item_num']<$itemNum){ $this->_rspOk();
$this->_rspErr(1, "The shard chest is insufficient"); // if ($itemDb['item_num']<$itemNum){
return; // $this->_rspErr(1, "The shard chest is insufficient");
} // return;
for ($i=1;$i<=$itemNum;$i++){ // }
if (! Nft::addNftByFragmentBox($itemMeta,$i)){ // for ($i=1;$i<=$itemNum;$i++){
$this->_rspErr(1, "server internal error"); // if (! Nft::addNftByFragmentBox($itemMeta,$i)){
return; // $this->_rspErr(1, "server internal error");
} // return;
Bag::decItemByUnIid($itemDb['item_uniid'], 1); // }
} // Bag::decItemByUnIid($itemDb['item_uniid'], 1);
$this->propertyChgService->addBagChg(); // }
$this->_rspData(array( // $this->propertyChgService->addBagChg();
'property_chg' => $this->propertyChgService->toDto(), // $this->_rspData(array(
)); // 'property_chg' => $this->propertyChgService->toDto(),
// ));
} }
} }

View File

@ -349,25 +349,25 @@ class BaseAuthedController extends BaseController {
break; break;
case mt\Item::RING_TYPE: case mt\Item::RING_TYPE:
{ {
// Nft::addNft($itemMeta); $this->_rspOk();return;
$currentSeason = mt\RankSeason::getCurrentSeason(); // $currentSeason = mt\RankSeason::getCurrentSeason();
if ($currentSeason){ // if ($currentSeason){
SqlHelper::insert( // SqlHelper::insert(
myself()->_getMarketMysql(), // myself()->_getMarketMysql(),
't_nft', // 't_nft',
array( // array(
'token_id' => Nft::genTempTokenId(), // 'token_id' => Nft::genTempTokenId(),
'token_type' => Nft::getTokenType($itemMeta), // 'token_type' => Nft::getTokenType($itemMeta),
'game_id' => 2006, // 'game_id' => 2006,
'item_id' => $itemMeta['id'], // 'item_id' => $itemMeta['id'],
'param1' => $currentSeason['id']-1, // 'param1' => $currentSeason['id']-1,
'owner_address' => myself()->_getOpenId(), // 'owner_address' => myself()->_getOpenId(),
'createtime' => myself()->_getNowTime(), // 'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime(), // 'modifytime' => myself()->_getNowTime(),
) // )
); // );
$propertyService->addUserChg(); // $propertyService->addUserChg();
} // }
} }
break; break;
case mt\Item::PARACHUTE_TYPE: case mt\Item::PARACHUTE_TYPE:

View File

@ -329,6 +329,7 @@ class ChipController extends BaseAuthedController
} }
public function syntheticChip(){ public function syntheticChip(){
$this->_rspOk();return;
$token_id_main = trim(getReqVal('token_id_main', 0)); $token_id_main = trim(getReqVal('token_id_main', 0));
$token_id_param = array_filter(explode(' ',getReqVal('token_id_param', 0))); $token_id_param = array_filter(explode(' ',getReqVal('token_id_param', 0)));
if (! $token_id_main || count($token_id_param)<=0 ) { if (! $token_id_main || count($token_id_param)<=0 ) {
@ -350,7 +351,7 @@ class ChipController extends BaseAuthedController
'token_id'=>$chip_param['token_id'], 'token_id'=>$chip_param['token_id'],
)); ));
$cumulative_cost += \services\FormulaService::getChipCumulativeCost($chip_param['chip_grade']); $cumulative_cost += \services\FormulaService::getChipCumulativeCost($chip_param['chip_grade']);
Chip::deleteChip(['token_id'=>$val]); // Chip::deleteChip(['token_id'=>$val]);
} }
{ {
//埋点 //埋点

View File

@ -91,6 +91,8 @@ class FragmentController extends BaseAuthedController
} }
public function syntheticFragment(){ public function syntheticFragment(){
$this->_rspOk();return;
$type = getReqVal('type', 0); $type = getReqVal('type', 0);
$unique_ids = getReqVal('unique_ids',''); $unique_ids = getReqVal('unique_ids','');
$unique_id_special = getReqVal('unique_id_special',''); $unique_id_special = getReqVal('unique_id_special','');
@ -151,7 +153,7 @@ class FragmentController extends BaseAuthedController
'unique_id'=>null, 'unique_id'=>null,
'token_id'=>$val, 'token_id'=>$val,
)); ));
Fragment::deleteFragment(['token_id'=>$val]); // Fragment::deleteFragment(['token_id'=>$val]);
} }
{ {
//埋点 //埋点
@ -163,7 +165,7 @@ class FragmentController extends BaseAuthedController
} }
// $this->_decItems($costItems); // $this->_decItems($costItems);
//生成NFT英雄 //生成NFT英雄
$tokenid = Nft::addNft($itemMeta); // $tokenid = Nft::addNft($itemMeta);
{ {
//埋点 //埋点
$nftDb = Nft::getNft($tokenid); $nftDb = Nft::getNft($tokenid);
@ -214,7 +216,7 @@ class FragmentController extends BaseAuthedController
'unique_id'=>null, 'unique_id'=>null,
'token_id'=>$val, 'token_id'=>$val,
)); ));
Fragment::deleteFragment(['token_id'=>$val]); // Fragment::deleteFragment(['token_id'=>$val]);
} }
{ {
//埋点 //埋点
@ -229,7 +231,7 @@ class FragmentController extends BaseAuthedController
$key = rand(0,count($itemMetaList)-1); $key = rand(0,count($itemMetaList)-1);
$itemMeta = $itemMetaList[$key]; $itemMeta = $itemMetaList[$key];
//生成NFT英雄 //生成NFT英雄
$tokenid = Nft::addNft($itemMeta); // $tokenid = Nft::addNft($itemMeta);
{ {
//埋点 //埋点
$nftDb = Nft::getNft($tokenid); $nftDb = Nft::getNft($tokenid);
@ -300,7 +302,7 @@ class FragmentController extends BaseAuthedController
'unique_id'=>null, 'unique_id'=>null,
'token_id'=>$val, 'token_id'=>$val,
)); ));
Fragment::deleteFragment(['token_id'=>$val]); // Fragment::deleteFragment(['token_id'=>$val]);
} }
{ {
//埋点 //埋点
@ -312,7 +314,7 @@ class FragmentController extends BaseAuthedController
} }
// $this->_decItems($costItems); // $this->_decItems($costItems);
//生成NFT英雄 //生成NFT英雄
$tokenid = Nft::addNft($itemMeta); // $tokenid = Nft::addNft($itemMeta);
{ {
//埋点 //埋点
$nftDb = Nft::getNft($tokenid); $nftDb = Nft::getNft($tokenid);
@ -364,7 +366,7 @@ class FragmentController extends BaseAuthedController
'unique_id'=>null, 'unique_id'=>null,
'token_id'=>$val, 'token_id'=>$val,
)); ));
Fragment::deleteFragment(['token_id'=>$val]); // Fragment::deleteFragment(['token_id'=>$val]);
} }
{ {
//埋点 //埋点
@ -379,7 +381,7 @@ class FragmentController extends BaseAuthedController
$key = rand(0,count($itemMetaList)-1); $key = rand(0,count($itemMetaList)-1);
$itemMeta = $itemMetaList[$key]; $itemMeta = $itemMetaList[$key];
//生成NFT英雄 //生成NFT英雄
$tokenid = Nft::addNft($itemMeta); // $tokenid = Nft::addNft($itemMeta);
{ {
//埋点 //埋点
$nftDb = Nft::getNft($tokenid); $nftDb = Nft::getNft($tokenid);

View File

@ -35,9 +35,9 @@ class GMController extends BaseAuthedController {
'.additem' => function () use($params) { '.additem' => function () use($params) {
$this->addItem($params); $this->addItem($params);
}, },
'.addnft' => function () use($params) { // '.addnft' => function () use($params) {
$this->addNft($params); // $this->addNft($params);
}, // },
'.addtili' => function () use($params) { '.addtili' => function () use($params) {
$this->addTili($params); $this->addTili($params);
}, },
@ -69,7 +69,6 @@ class GMController extends BaseAuthedController {
.getsystime //获取服务器时间 .getsystime //获取服务器时间
.setsystime //设置服务器时间,示例:.setsystime 2021-12-08 00:00:00 .setsystime //设置服务器时间,示例:.setsystime 2021-12-08 00:00:00
.reset_mission //重置任务 .reset_mission //重置任务
.addnft 道具id //添加nft
END END
)); ));
} }
@ -93,44 +92,44 @@ END
)); ));
} }
private function addNft($params) // private function addNft($params)
{ // {
$itemId = getXVal($params, 0, 0); // $itemId = getXVal($params, 0, 0);
$propertyChgService = new services\PropertyChgService(); // $propertyChgService = new services\PropertyChgService();
$awardService = new services\AwardService(); // $awardService = new services\AwardService();
//
$itemMeta = mt\Item::get($itemId); // $itemMeta = mt\Item::get($itemId);
if ($itemMeta) { // if ($itemMeta) {
$tokenType = Nft::getTokenType($itemMeta); // $tokenType = Nft::getTokenType($itemMeta);
if ($tokenType == Nft::NONE_TYPE) { // if ($tokenType == Nft::NONE_TYPE) {
myself()->_rspErr(1, 'param item_id error'); // myself()->_rspErr(1, 'param item_id error');
return; // return;
} else { // } else {
SqlHelper::insert( // SqlHelper::insert(
myself()->_getMarketMysql(), // myself()->_getMarketMysql(),
't_nft', // 't_nft',
array( // array(
'token_id' => Nft::genTempTokenId(), // 'token_id' => Nft::genTempTokenId(),
'token_type' => $tokenType, // 'token_type' => $tokenType,
'game_id' => 2006, // 'game_id' => 2006,
'item_id' => $itemId, // 'item_id' => $itemId,
'owner_address' => myself()->_getOpenId(), // 'owner_address' => myself()->_getOpenId(),
'createtime' => myself()->_getNowTime(), // 'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime(), // 'modifytime' => myself()->_getNowTime(),
) // )
); // );
} // }
} else { // } else {
myself()->_rspErr(1, 'param item_id error'); // myself()->_rspErr(1, 'param item_id error');
return; // return;
} // }
//
$this->_rspData(array( // $this->_rspData(array(
'text' => 'add nft success', // 'text' => 'add nft success',
'award' => $awardService->toDto(), // 'award' => $awardService->toDto(),
'property_chg' => $propertyChgService->toDto(), // 'property_chg' => $propertyChgService->toDto(),
)); // ));
} // }
private function addTili($params) private function addTili($params)
{ {

View File

@ -461,6 +461,7 @@ class GunController extends BaseAuthedController {
} }
public function receive(){ public function receive(){
$this->_rspOk();return;
$type = getReqVal('type', 0); $type = getReqVal('type', 0);
$gunUniId = getReqVal('gun_uniid', 0); $gunUniId = getReqVal('gun_uniid', 0);
$gunDb = Gun::find($gunUniId); $gunDb = Gun::find($gunUniId);
@ -561,12 +562,12 @@ class GunController extends BaseAuthedController {
$costGunDb = Gun::find($costGunUniId); $costGunDb = Gun::find($costGunUniId);
if ($costGunDb['token_id']){ if ($costGunDb['token_id']){
SqlHelper::update( // SqlHelper::update(
myself()->_getMarketMysql(), // myself()->_getMarketMysql(),
't_nft', // 't_nft',
['token_id'=>$costGunDb['token_id']], // ['token_id'=>$costGunDb['token_id']],
['deleted'=>1] // ['deleted'=>1]
); // );
}else{ }else{
Gun::update($costGunUniId, Gun::update($costGunUniId,
array( array(

View File

@ -228,6 +228,7 @@ class HeroController extends BaseAuthedController {
public function receive() public function receive()
{ {
$this->_rspOk();return;
$type = getReqVal('type', 0); $type = getReqVal('type', 0);
$heroUniId = getReqVal('hero_uniid', 0); $heroUniId = getReqVal('hero_uniid', 0);
$heroDb = Hero::find($heroUniId); $heroDb = Hero::find($heroUniId);
@ -346,12 +347,12 @@ class HeroController extends BaseAuthedController {
if ($nextQualityMeta) { if ($nextQualityMeta) {
$costHeroDb = Hero::find($costHeroUniId); $costHeroDb = Hero::find($costHeroUniId);
if ($costHeroDb['token_id']){ if ($costHeroDb['token_id']){
SqlHelper::update( // SqlHelper::update(
myself()->_getMarketMysql(), // myself()->_getMarketMysql(),
't_nft', // 't_nft',
['token_id'=>$costHeroDb['token_id']], // ['token_id'=>$costHeroDb['token_id']],
['deleted'=>1] // ['deleted'=>1]
); // );
}else{ }else{
Hero::update($costHeroUniId, Hero::update($costHeroUniId,
array( array(

View File

@ -60,9 +60,9 @@ class UserController extends BaseAuthedController {
//测试服 //测试服
if (!$userInfo) { if (!$userInfo) {
$this->createNewUserV2($userName); $this->createNewUserV2($userName);
$this->_addFreeItem(); //测试需要,上线要删除 // $this->_addFreeItem(); //测试需要,上线要删除
$this->addFragmentBox(); //测试需要,上线要删除 // $this->addFragmentBox(); //测试需要,上线要删除
$this->addChip(); //测试需要,上线要删除 // $this->addChip(); //测试需要,上线要删除
$userInfo = $this->_getOrmUserInfo(); $userInfo = $this->_getOrmUserInfo();
$this->_setV(TN_RANK_STATUS, 0, 1); $this->_setV(TN_RANK_STATUS, 0, 1);
} }
@ -329,7 +329,7 @@ class UserController extends BaseAuthedController {
public function active() public function active()
{ {
$this->_rspOk();return;
$hero_uniid = getReqVal('hero_uniid', 0); $hero_uniid = getReqVal('hero_uniid', 0);
$gun_uniid = getReqVal('gun_uniid', 0); $gun_uniid = getReqVal('gun_uniid', 0);

View File

@ -49,19 +49,19 @@ class Chip extends BaseModel
'token_id' => $nftDb['token_id'], 'token_id' => $nftDb['token_id'],
) )
); );
if (!$row) { // if (!$row) {
$itemMeta = mt\Item::get($nftDb['item_id']); // $itemMeta = mt\Item::get($nftDb['item_id']);
if ($itemMeta) { // if ($itemMeta) {
self::addChip($nftDb['item_id'], $nftDb['token_id']); // self::addChip($nftDb['item_id'], $nftDb['token_id']);
$row = SqlHelper::ormSelectOne( // $row = SqlHelper::ormSelectOne(
myself()->_getSelfMysql(), // myself()->_getSelfMysql(),
't_chip', // 't_chip',
array( // array(
'token_id' => $nftDb['token_id'], // 'token_id' => $nftDb['token_id'],
) // )
); // );
} // }
} // }
if ($row) { if ($row) {
$cb($row); $cb($row);
} }
@ -239,14 +239,14 @@ class Chip extends BaseModel
); );
} }
public static function deleteChip($whereKv){ // public static function deleteChip($whereKv){
SqlHelper::update( // SqlHelper::update(
myself()->_getMarketMysql(), // myself()->_getMarketMysql(),
't_nft', // 't_nft',
$whereKv, // $whereKv,
['deleted'=>1] // ['deleted'=>1]
); // );
} // }
public static function updateRandAttr($chip){ public static function updateRandAttr($chip){
$attr_pool = mt\ChipAttr::generateOneAttr($chip['chip_type']); $attr_pool = mt\ChipAttr::generateOneAttr($chip['chip_type']);

View File

@ -23,7 +23,6 @@ class Fragment extends BaseModel
'deleted' => 0 'deleted' => 0
) )
); );
// print_r($nft);die;
foreach ($nft as $nftDb) { foreach ($nft as $nftDb) {
$row = SqlHelper::ormSelectOne( $row = SqlHelper::ormSelectOne(
myself()->_getSelfMysql(), myself()->_getSelfMysql(),
@ -32,19 +31,19 @@ class Fragment extends BaseModel
'token_id' => $nftDb['token_id'], 'token_id' => $nftDb['token_id'],
) )
); );
if (!$row) { // if (!$row) {
$itemMeta = mt\Item::get($nftDb['item_id']); // $itemMeta = mt\Item::get($nftDb['item_id']);
if ($itemMeta) { // if ($itemMeta) {
self::addFragment($itemMeta, $nftDb['token_id']); // self::addFragment($itemMeta, $nftDb['token_id']);
$row = SqlHelper::ormSelectOne( // $row = SqlHelper::ormSelectOne(
myself()->_getSelfMysql(), // myself()->_getSelfMysql(),
't_fragment', // 't_fragment',
array( // array(
'token_id' => $nftDb['token_id'], // 'token_id' => $nftDb['token_id'],
) // )
); // );
} // }
} // }
if ($row) { if ($row) {
$cb($row); $cb($row);
} }
@ -95,14 +94,14 @@ class Fragment extends BaseModel
} }
public static function deleteFragment($whereKv){ // public static function deleteFragment($whereKv){
SqlHelper::update( // SqlHelper::update(
myself()->_getMarketMysql(), // myself()->_getMarketMysql(),
't_nft', // 't_nft',
$whereKv, // $whereKv,
['deleted'=>1] // ['deleted'=>1]
); // );
} // }
} }

View File

@ -115,20 +115,20 @@ class Gun extends BaseModel {
'token_id' => $nftDb['token_id'], 'token_id' => $nftDb['token_id'],
) )
); );
if (!$row) { // if (!$row) {
$itemMeta = mt\Item::get($nftDb['item_id']); // $itemMeta = mt\Item::get($nftDb['item_id']);
if ($itemMeta) { // if ($itemMeta) {
self::addNftGun($itemMeta, $nftDb['token_id']); // self::addNftGun($itemMeta, $nftDb['token_id']);
$row = SqlHelper::ormSelectOne( // $row = SqlHelper::ormSelectOne(
myself()->_getSelfMysql(), // myself()->_getSelfMysql(),
't_gun', // 't_gun',
array( // array(
'token_id' => $nftDb['token_id'], // 'token_id' => $nftDb['token_id'],
) // )
); // );
} // }
//
} // }
if ($row) { if ($row) {
$cb($row); $cb($row);
} }

View File

@ -85,7 +85,7 @@ class Hero extends BaseModel {
}); });
return $cegUpLimit; return $cegUpLimit;
} }
//james
public static function getHeroList($cb) public static function getHeroList($cb)
{ {
SqlHelper::ormSelect( SqlHelper::ormSelect(
@ -107,21 +107,21 @@ class Hero extends BaseModel {
'token_id' => $nftDb['token_id'], 'token_id' => $nftDb['token_id'],
) )
); );
if (!$row) { // if (!$row) {
$itemMeta = mt\Item::get($nftDb['item_id']); // $itemMeta = mt\Item::get($nftDb['item_id']);
if ($itemMeta) { // if ($itemMeta) {
self::addNftHero($itemMeta, $nftDb['token_id']); // self::addNftHero($itemMeta, $nftDb['token_id']);
$row = SqlHelper::ormSelectOne( // $row = SqlHelper::ormSelectOne(
myself()->_getSelfMysql(), // myself()->_getSelfMysql(),
't_hero', // 't_hero',
array( // array(
'token_id' => $nftDb['token_id'], // 'token_id' => $nftDb['token_id'],
) // )
); // );
User::upsertHeadList($itemMeta); // User::upsertHeadList($itemMeta);
} // }
//
} // }
if ($row) { if ($row) {
$cb($row); $cb($row);
} }

View File

@ -189,16 +189,16 @@ class Nft extends BaseModel {
if ($initQualityMeta) { if ($initQualityMeta) {
$randAttr = mt\GunQuality::getRandAttr($initQualityMeta); $randAttr = mt\GunQuality::getRandAttr($initQualityMeta);
} }
SqlHelper::update( // SqlHelper::update(
myself()->_getMarketMysql(), // myself()->_getMarketMysql(),
't_nft', // 't_nft',
array( // array(
'token_id' => $nft['token_id'] // 'token_id' => $nft['token_id']
), // ),
array( // array(
'rand_attr' => json_encode($randAttr) // 'rand_attr' => json_encode($randAttr)
) // )
); // );
} }
{ {
foreach($randAttr as &$attr) { foreach($randAttr as &$attr) {
@ -250,59 +250,59 @@ class Nft extends BaseModel {
} }
} }
public static function addNftByFragmentBox($itemMeta,$num=0){ // public static function addNftByFragmentBox($itemMeta,$num=0){
if ($itemMeta) { // if ($itemMeta) {
$tokenType = Nft::getTokenType($itemMeta); // $tokenType = Nft::getTokenType($itemMeta);
if ($tokenType == Nft::NONE_TYPE) { // if ($tokenType == Nft::NONE_TYPE) {
return false; // return false;
} else { // } else {
SqlHelper::insert( // SqlHelper::insert(
myself()->_getMarketMysql(), // myself()->_getMarketMysql(),
't_nft', // 't_nft',
array( // array(
'token_id' => self::genTempTokenId(), // 'token_id' => self::genTempTokenId(),
'token_type' => $tokenType, // 'token_type' => $tokenType,
'game_id' => 2006, // 'game_id' => 2006,
'item_id' => $itemMeta['include_item_id'], // 'item_id' => $itemMeta['include_item_id'],
'owner_address' => myself()->_getOpenId(), // 'owner_address' => myself()->_getOpenId(),
'createtime' => myself()->_getNowTime(), // 'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime(), // 'modifytime' => myself()->_getNowTime(),
) // )
); // );
return true; // return true;
} // }
} else { // } else {
return false; // return false;
} // }
} // }
public static function addNft($itemMeta){ // public static function addNft($itemMeta){
if ($itemMeta) { // if ($itemMeta) {
$tokenID = self::genTempTokenId(); // $tokenID = self::genTempTokenId();
$tokenType = Nft::getTokenType($itemMeta); // $tokenType = Nft::getTokenType($itemMeta);
//
if ($tokenType == Nft::NONE_TYPE) { // if ($tokenType == Nft::NONE_TYPE) {
return false; // return false;
} else { // } else {
SqlHelper::insert( // SqlHelper::insert(
myself()->_getMarketMysql(), // myself()->_getMarketMysql(),
't_nft', // 't_nft',
array( // array(
'token_id' => $tokenID, // 'token_id' => $tokenID,
'token_type' => $tokenType, // 'token_type' => $tokenType,
'game_id' => 2006, // 'game_id' => 2006,
'item_id' => $itemMeta['id'], // 'item_id' => $itemMeta['id'],
'owner_address' => myself()->_getOpenId(), // 'owner_address' => myself()->_getOpenId(),
'createtime' => myself()->_getNowTime(), // 'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime(), // 'modifytime' => myself()->_getNowTime(),
) // )
); // );
return $tokenID; // return $tokenID;
} // }
} else { // } else {
return false; // return false;
} // }
} // }
private static function parseTags($tagsStr) private static function parseTags($tagsStr)
{ {

View File

@ -37,8 +37,6 @@ class UserSeasonRing extends BaseModel
$cb($row); $cb($row);
} }
); );
// print_r(NftService::getRing(phpcommon\extractOpenId($targetId)));die;
foreach (NftService::getRing(phpcommon\extractOpenId($targetId)) as $nftDb) { foreach (NftService::getRing(phpcommon\extractOpenId($targetId)) as $nftDb) {
if (! $nftDb['deleted']){ if (! $nftDb['deleted']){
$row = SqlHelper::ormSelectOne( $row = SqlHelper::ormSelectOne(
@ -48,22 +46,22 @@ class UserSeasonRing extends BaseModel
'token_id' => $nftDb['token_id'], 'token_id' => $nftDb['token_id'],
) )
); );
if (!$row) { // if (!$row) {
$itemMeta = mt\Item::get($nftDb['item_id']); // $itemMeta = mt\Item::get($nftDb['item_id']);
if ($itemMeta) { // if ($itemMeta) {
self::addNftRing($itemMeta, $nftDb['token_id'],$targetId,$nftDb['param1']); // self::addNftRing($itemMeta, $nftDb['token_id'],$targetId,$nftDb['param1']);
$row = SqlHelper::ormSelectOne( // $row = SqlHelper::ormSelectOne(
myself()->_getSelfMysql(), // myself()->_getSelfMysql(),
't_user_season_ring', // 't_user_season_ring',
array( // array(
'token_id' => $nftDb['token_id'], // 'token_id' => $nftDb['token_id'],
) // )
); // );
} // }
if ($row) { // if ($row) {
$cb($row); // $cb($row);
} // }
} // }
} }
} }

View File

@ -85,33 +85,33 @@ class NftService extends BaseService {
} }
} }
public static function addNft($itemId,$token_id){ // public static function addNft($itemId,$token_id){
$itemMeta = Item::get($itemId); // $itemMeta = Item::get($itemId);
if ($itemMeta) { // if ($itemMeta) {
$tokenType = Nft::getTokenType($itemMeta); // $tokenType = Nft::getTokenType($itemMeta);
if ($tokenType == Nft::NONE_TYPE) { // if ($tokenType == Nft::NONE_TYPE) {
myself()->_rspErr(1, 'param item_id error'); // myself()->_rspErr(1, 'param item_id error');
return false; // return false;
} else { // } else {
SqlHelper::insert( // SqlHelper::insert(
myself()->_getMarketMysql(), // myself()->_getMarketMysql(),
't_nft', // 't_nft',
array( // array(
'token_id' => $token_id, // 'token_id' => $token_id,
'token_type' => $tokenType, // 'token_type' => $tokenType,
'game_id' => 2006, // 'game_id' => 2006,
'item_id' => $itemId, // 'item_id' => $itemId,
'owner_address' => myself()->_getOpenId(), // 'owner_address' => myself()->_getOpenId(),
'createtime' => myself()->_getNowTime(), // 'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime(), // 'modifytime' => myself()->_getNowTime(),
) // )
); // );
return true; // return true;
} // }
} else { // } else {
myself()->_rspErr(1, 'param item_id error'); // myself()->_rspErr(1, 'param item_id error');
return false; // return false;
} // }
} // }
} }