_getAccountId(); } $singleList = BattleSettlement::getSingleList($accountId,$type); $historyList = BattleHistory::orderBy($singleList,'desc'); $data = array(); foreach ($historyList as $k=>$history){ if ($k < 40){ array_push($data,$history); } } $this->_rspData(array( 'data' => $data )); } public function showBattleHistory(){ $accountId = getReqVal('target_id', ''); $battleUuid = getReqVal('battle_uuid', 0); $roomUuid = getReqVal('room_uuid', 0); if ( !$battleUuid){ $this->_rspErr(1,'param battle_uuid error'); return; } if ( !$roomUuid){ $this->_rspErr(1,'param room_uuid error'); return; } $teamBattleDb= BattleSettlement::findTeamByTargetId($accountId,$battleUuid,$roomUuid); if (!$teamBattleDb){ $this->_rspErr(1,'param error'); return; } $data = json_decode($teamBattleDb['data'],true); $room_mode = getXVal($data,'room_mode', 0); $list = array($data); if ($room_mode == \services\TameBattleDataService::ROOM_MODE_MOBA){ $rows = BattleSettlement::findTeamByRoomUuid($accountId,$roomUuid); foreach ($rows as $row){ if ($battleUuid != $row['battle_uuid']){ array_push($list,json_decode($row['data'],true)); } } } $propertyChgService = new services\PropertyChgService(); $propertyChgService->addUserChg(); $this->_rspData( array( 'info'=>$list, 'property_chg' => $propertyChgService->toDto(), ) ); } }