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` (
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
`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',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
UNIQUE KEY `account_id_season` (`account_id`, `season`),
UNIQUE KEY `token_id` (`token_id`)
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!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/User.php');
require_once('models/Nft.php');
require_once('models/UserSeasonRing.php');
require_once('models/Parachute.php');
require_once('mt/Parameter.php');
require_once('mt/RankSeason.php');
@ -24,6 +25,7 @@ use models\GunSkin;
use models\User;
use models\Nft;
use models\Parachute;
use models\UserSeasonRing;
class BaseAuthedController extends BaseController {
@ -349,25 +351,8 @@ class BaseAuthedController extends BaseController {
break;
case mt\Item::RING_TYPE:
{
$this->_rspOk();return;
// $currentSeason = mt\RankSeason::getCurrentSeason();
// 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();
// }
UserSeasonRing::addRing($itemMeta);
$propertyService->addUserChg();
}
break;
case mt\Item::PARACHUTE_TYPE:

View File

@ -16,11 +16,7 @@ class UserSeasonRing extends BaseModel
{
$ringList = array();
self::getRingList($targetId,function ($row) use(&$ringList) {
$list = array(
'item_id' =>$row['item_id'],
'season_id' =>$row['season'],
);
array_push($ringList, $list);
array_push($ringList, $row['item_id']);
});
return $ringList;
}
@ -37,61 +33,25 @@ class UserSeasonRing extends BaseModel
$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 addNftRing($itemMeta, $tokenId,$accountId,$param1)
public static function addRing($itemMeta)
{
return self::internalAddHero(
myself()->_getMysql($tokenId),
myself()->_getSelfMysql(),
$itemMeta,
$accountId,
$tokenId,
$param1);
myself()->_getAccountId()
);
}
public static function internalAddHero($conn, $itemMeta, $accountId, $tokenId,$param1)
public static function internalAddHero($conn, $itemMeta, $accountId)
{
$fieldsKv = array(
'season' => $param1,
'account_id' => $accountId,
'item_id' => $itemMeta['id'],
'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime()
);
if ($accountId) {
$fieldsKv['account_id'] = $accountId;
}
if ($tokenId) {
$fieldsKv['token_id'] = $tokenId;
}
SqlHelper::insert(
$conn,

View File

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