This commit is contained in:
hujiabin 2022-11-17 21:10:30 +08:00
parent 8a961190cd
commit db8f54e2ab
4 changed files with 14 additions and 73 deletions

View File

@ -717,14 +717,10 @@ DROP TABLE IF EXISTS `t_user_season_ring`;
CREATE TABLE `t_user_season_ring` ( CREATE TABLE `t_user_season_ring` (
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)', `account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
`token_id` varchar(60) COMMENT 'token_id',
`season` int(11) NOT NULL DEFAULT '0' COMMENT '赛季',
`item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id', `item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`), PRIMARY KEY (`idx`)
UNIQUE KEY `account_id_season` (`account_id`, `season`),
UNIQUE KEY `token_id` (`token_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;

View File

@ -10,6 +10,7 @@ require_once('models/HeroSkin.php');
require_once('models/GunSkin.php'); require_once('models/GunSkin.php');
require_once('models/User.php'); require_once('models/User.php');
require_once('models/Nft.php'); require_once('models/Nft.php');
require_once('models/UserSeasonRing.php');
require_once('models/Parachute.php'); require_once('models/Parachute.php');
require_once('mt/Parameter.php'); require_once('mt/Parameter.php');
require_once('mt/RankSeason.php'); require_once('mt/RankSeason.php');
@ -24,6 +25,7 @@ use models\GunSkin;
use models\User; use models\User;
use models\Nft; use models\Nft;
use models\Parachute; use models\Parachute;
use models\UserSeasonRing;
class BaseAuthedController extends BaseController { class BaseAuthedController extends BaseController {
@ -349,25 +351,8 @@ class BaseAuthedController extends BaseController {
break; break;
case mt\Item::RING_TYPE: case mt\Item::RING_TYPE:
{ {
$this->_rspOk();return; UserSeasonRing::addRing($itemMeta);
// $currentSeason = mt\RankSeason::getCurrentSeason(); $propertyService->addUserChg();
// if ($currentSeason){
// SqlHelper::insert(
// myself()->_getMarketMysql(),
// 't_nft',
// array(
// 'token_id' => Nft::genTempTokenId(),
// 'token_type' => Nft::getTokenType($itemMeta),
// 'game_id' => 2006,
// 'item_id' => $itemMeta['id'],
// 'param1' => $currentSeason['id']-1,
// 'owner_address' => myself()->_getOpenId(),
// 'createtime' => myself()->_getNowTime(),
// 'modifytime' => myself()->_getNowTime(),
// )
// );
// $propertyService->addUserChg();
// }
} }
break; break;
case mt\Item::PARACHUTE_TYPE: case mt\Item::PARACHUTE_TYPE:

View File

@ -16,11 +16,7 @@ class UserSeasonRing extends BaseModel
{ {
$ringList = array(); $ringList = array();
self::getRingList($targetId,function ($row) use(&$ringList) { self::getRingList($targetId,function ($row) use(&$ringList) {
$list = array( array_push($ringList, $row['item_id']);
'item_id' =>$row['item_id'],
'season_id' =>$row['season'],
);
array_push($ringList, $list);
}); });
return $ringList; return $ringList;
} }
@ -37,61 +33,25 @@ class UserSeasonRing extends BaseModel
$cb($row); $cb($row);
} }
); );
foreach (NftService::getRing(phpcommon\extractOpenId($targetId)) as $nftDb) {
if (! $nftDb['deleted']){
$row = SqlHelper::ormSelectOne(
myself()->_getSelfMysql(),
't_user_season_ring',
array(
'token_id' => $nftDb['token_id'],
)
);
// if (!$row) {
// $itemMeta = mt\Item::get($nftDb['item_id']);
// if ($itemMeta) {
// self::addNftRing($itemMeta, $nftDb['token_id'],$targetId,$nftDb['param1']);
// $row = SqlHelper::ormSelectOne(
// myself()->_getSelfMysql(),
// 't_user_season_ring',
// array(
// 'token_id' => $nftDb['token_id'],
// )
// );
// }
// if ($row) {
// $cb($row);
// }
// }
}
} }
} public static function addRing($itemMeta)
public static function addNftRing($itemMeta, $tokenId,$accountId,$param1)
{ {
return self::internalAddHero( return self::internalAddHero(
myself()->_getMysql($tokenId), myself()->_getSelfMysql(),
$itemMeta, $itemMeta,
$accountId, myself()->_getAccountId()
$tokenId, );
$param1);
} }
public static function internalAddHero($conn, $itemMeta, $accountId, $tokenId,$param1) public static function internalAddHero($conn, $itemMeta, $accountId)
{ {
$fieldsKv = array( $fieldsKv = array(
'season' => $param1, 'account_id' => $accountId,
'item_id' => $itemMeta['id'], 'item_id' => $itemMeta['id'],
'createtime' => myself()->_getNowTime(), 'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime() 'modifytime' => myself()->_getNowTime()
); );
if ($accountId) {
$fieldsKv['account_id'] = $accountId;
}
if ($tokenId) {
$fieldsKv['token_id'] = $tokenId;
}
SqlHelper::insert( SqlHelper::insert(
$conn, $conn,

View File

@ -87,9 +87,9 @@ class MissionService extends BaseService {
'refreshtime' => 0 'refreshtime' => 0
); );
} }
// if (myself()->_getNowTime() - $this->offerRewartdMission['refreshtime'] >= 86400){ if (myself()->_getNowTime() - $this->offerRewartdMission['refreshtime'] >= 86400){
$this->refreshOfferRewardMission(); $this->refreshOfferRewardMission();
// } }
} }
public function getMissionDto($userInfo, $seasonDb, $missionDb, $missionMeta) public function getMissionDto($userInfo, $seasonDb, $missionDb, $missionMeta)