$v){ $data['param'.($k+1)] = $v; } $logInfo['properties'] = $data; TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo); } private static function userInfo() { $user = User::find(myself()->_getAccountId()); $info = array( 'account_id' => myself()->_getAccountId(), //账号id 'channel' => myself()->_getChannel(), //账号channel 'openid' => myself()->_getOpenId(), //账号openid 'name' => $user['name'], //用户名字 'rank' => $user['rank'], //段位 'gold' => $user['gold'], //CEG金币 'diamond' => $user['diamond'], //CEC钻石 'account_register_time' => myself()->_getRegisterTime(), //账号注册时间 'ip' => $_SERVER['REMOTE_ADDR'], //用户ip '_os' => getReqVal('_os', ''), '_net' => getReqVal('_net', ''), ); return $info; } private static function nftInfo($old_nft,$new_nft) { foreach ($old_nft as $k => $v){ if ($k == 'hero_id'){ $old_nft['item_id'] = $old_nft[$k]; }else if ($k == 'gun_id'){ $old_nft['item_id'] = $old_nft[$k]; }else if($k == 'item_id'){ $old_nft['item_id'] = $old_nft[$k]; } } foreach ($new_nft as $k => $v){ if ($k == 'hero_id'){ $new_nft['item_id'] = $new_nft[$k]; }else if ($k == 'gun_id'){ $new_nft['item_id'] = $new_nft[$k]; }else if($k == 'item_id'){ $new_nft['item_id'] = $new_nft[$k]; } } $info = array( 'nft_unique_id' => $old_nft['idx'], //NFT idx 'nft_token_id' => $old_nft['token_id']?$old_nft['token_id']:null, //NFT token ID 'nft_item_id' => $old_nft['item_id']?$old_nft['item_id']:null, //NFT item ID 'nft_quality' => isset($old_nft['quality']) ? $old_nft['quality'] : null, //NFT品阶 'nft_level' => $old_nft['level'] ? $old_nft['level'] : null, //NFT等级 'nft_quality2' => isset($new_nft['quality']) ? $new_nft['quality'] : null, //NFT品阶2 'nft_level2' => $new_nft['level'] ? $new_nft['level'] : null, //NFT等级2 'nft_info' => json_encode($old_nft), 'new_nft' => json_encode($new_nft) ); return $info; } private static function nftProductInfo($nft) { foreach ($nft as $k => $v){ if ($k == 'hero_id'){ $nft['item_id'] = $nft[$k]; }else if ($k == 'gun_id'){ $nft['item_id'] = $nft[$k]; }else if($k == 'item_id'){ $nft['item_id'] = $nft[$k]; } } $info = array( 'nft_unique_id' => $nft['idx'], //NFT idx 'nft_token_id' => $nft['token_id']?$nft['token_id']:null, //NFT token ID 'nft_item_id' => $nft['item_id']?$nft['item_id']:null, //NFT item ID 'nft_info' => json_encode($nft), ); return $info; } private static function tokenRecord() { // $logInfo['log_class'] = $logInfo['log_class']; // unset($logInfo['log_class']); $data = array( "#account_id" => myself()->_getAccountId(), "#event_name"=> "token_record", "#ip"=> $_SERVER['REMOTE_ADDR'], "#time"=> myself()->_getNowTime(), "#type"=> "track", "properties"=>'' ); return $data; } }