$nft['idx'], "owner_address" => $nft['owner_address'], "item_id" => $nft['item_id'], "token_id" => $nft['token_id'], "token_type" => $nft['token_type'], "contract_address" => $nft['contract_address'], 'image' => $image, 'full_image' => $full_image, "details" => array(), ); array_push($listInfo,$info); } } $this->_rspData(array( 'nfts' => $listInfo, )); } public function getWebInfo(){ $channel = getReqVal('channel', ''); $openId = getReqVal('openId', ''); $accountId = BC_POLY_CHANNEL.'_'.$this->_getGameId().'_'.$channel.'_'.$openId; $userDb = User::find($accountId); if (!$userDb){ $this->_rspErr(1, 'user not found'); return; } $info = array( 'loginVal' => 0, 'battleTimes' => 0, 'winTimes' => 0, 'kills' => 0, 'getGoldVal' => 0, ); $accountBindDb = SqlHelper::ormSelectOne( myself()->_getMysql($openId), 't_sub_user_bind', array( 'org_account_id' => $accountId, ) ); $accountId = $accountBindDb ? $accountBindDb['cur_account_id'] : $accountId ; $redis = $this->_getRedis($accountId); $lastActiveTime = $redis->get(LAST_ACTIVE_TIME . $accountId); if (!empty($lastActiveTime) && $lastActiveTime > myself()->_getNowDaySeconds()){ $info['loginVal'] = 1; } // $loginDyn = SqlHelper::ormSelectOne( // myself()->_getMysql($openId), // 't_dyndata', // array( // 'account_id' => $accountId, // 'x' => TN_DAILY_LOGINS, // 'y' => 0, // ) // ); // if ($loginDyn){ // $info['loginVal'] = $loginDyn['val']; // if (myself()->_getDaySeconds($loginDyn['modifytime']) < myself()->_getNowDaySeconds()) { // $info['loginVal'] = 0; // } // } $battleDb = SqlHelper::ormSelectOne( myself()->_getMysql($openId), 't_battle', array( 'account_id' => $accountId, ) ); if ($battleDb){ $hisBattleData = json_decode($battleDb['battle_data'], true); $todayBattleData = getXVal($hisBattleData, 'today_data', array()); if (myself()->_getDaySeconds(getXVal($todayBattleData, 'modifytime', 0)) == myself()->_getNowDaySeconds()) { $info['battleTimes'] = getXVal($todayBattleData, "total_battle_times", 0); $info['winTimes'] = getXVal($todayBattleData, "total_special_win_times", 0); $info['kills'] = getXVal($todayBattleData, "total_kills_times", 0); } } $getGoldDyn = SqlHelper::ormSelectOne( myself()->_getMysql($openId), 't_dyndata', array( 'account_id' => $accountId, 'x' => TN_DAILY_GATHER_GOLD, 'y' => 0, ) ); if ($getGoldDyn){ $info['getGoldVal'] = $getGoldDyn['val']; if (myself()->_getDaySeconds($getGoldDyn['modifytime']) < myself()->_getNowDaySeconds()) { $info['getGoldVal'] = 0; } } $this->_rspData(array( 'info' => $info, )); } }